A photosensitive field-effect transistor which can be configured to provide an electrical response when illuminated by electromagnetic radiation incident on the transistor, wherein the photosensitive field-effect transistor comprises: - at least one electrically conducting source electrode (24S, 34S, 44S, 104S) and at least one electrically conducting drain electrode (24D, 34D, 44D, 104D), - a layer of two-dimensional material which forms a horizontal transistor channel (23, 33, 43, 103) configured to transport current between the at least one source electrode (24S, 34S, 44S, 104S) and the at least one drain electrode (24D, 34D, 44D, 104D), - at least one horizontal electrically conducting first gate electrode (24G, 34G, 44G, 1041) which overlies or underlies the transistor channel (23, 33, 43, 103) on a first side of the transistor channel (23, 33, 43, 103), and at least one gate-insulating layer (25, 35, 45, 105) between the first gate electrode (24G, 34G, 44G, 1041) and the transistor channel (23, 33, 43, 103), - a horizontal photoactive layer (22, 32, 42, 82, 92, 102) with a first horizontal surface and a second horizontal surface, wherein at least a part of the first horizontal surface of the photoactive layer (22, 32, 42, 82, 92, 102) is in contact with a second side of the transistor channel (23, 33, 43, 103), and the area of the second horizontal surface is a photoactive area, and the photoactive layer (22, 32, 42, 82, 92, 102) can be configured to donate charge carriers to the transistor channel (23, 33, 43, 103) when electromagnetic radiation is absorbed in the photoactive layer (22, 32, 42, 82, 92, 102), wherein the photosensitive field-effect transistor also comprises a second gate electrode (21, 31, 411, 412) which is in contact with the second horizontal surface of the photoactive layer (22, 32, 42, 82, 92, 102) on one or more contact areas, characterized in that the one or more contact areas form a contact pattern on the second horizontal surface of the photoactive layer so that the total area of the one or more contact areas is a pattern area, and the ratio between the pattern area and the photoactive area is in the range 1% - 50%. - at least one electrically conducting source electrode (24S, 34S, 44S, 104S) and at least one electrically conducting drain electrode (24D, 34D, 44D, 104D), - a layer of two-dimensional material which forms a horizontal transistor channel (23, 33, 43, 103) configured to transport current between the at least one source electrode (24S, 34S, 44S, 104S) and the at least one drain electrode (24D, 34D, 44D, 104D), - at least one horizontal electrically conducting first gate electrode (24G, 34G, 44G, 1041) which overlies or underlies the transistor channel (23, 33, 43, 103) on a first side of the transistor channel (23, 33, 43, 103), and at least one gate-insulating layer (25, 35, 45, 105) between the first gate electrode (24G, 34G, 44G, 1041) and the transistor channel (23, 33, 43, 103), - a horizontal photoactive layer (22, 32, 42, 82, 92, 102) with a first horizontal surface and a second horizontal surface, wherein at least a part of the first horizontal surface of the photoactive layer (22, 32, 42, 82, 92, 102) is in contact with a second side of the transistor channel (23, 33, 43, 103), and the area of the second horizontal surface is a photoactive area, and the photoactive layer (22, 32, 42, 82, 92, 102) can be configured to donate charge carriers to the transistor channel (23, 33, 43, 103) when electromagnetic radiation is absorbed in the photoactive layer (22, 32, 42, 82, 92, 102), wherein the photosensitive field-effect transistor also comprises a second gate electrode (21, 31, 411, 412) which is in contact with the second horizontal surface of the photoactive layer (22, 32, 42, 82, 92, 102) on one or more contact areas, characterized in that the one or more contact areas form a contact pattern on the second horizontal surface of the photoactive layer so that the total area of the one or more contact areas is a pattern area, and the ratio between the pattern area and the photoactive area is in the range 1% - 50%.