A police officer accused of propositioning a vulnerable woman for sex told a misconduct hearing he had been "set up".
PC Darren Booth, 40, denied ever asking the woman for sex and said that he met with her after his shift "for legitimate policing reasons".
He said the woman, known as Miss A, had told him she had information about counterfeit cigarette operations.
PC Booth said he believed Miss A had "set me up to get me into trouble".
Miss A, 36, was among a group of street drinkers in Castleford town centre in 2019 and alleges PC Booth propositioned her when he was called to deal with their anti-social behaviour.
She told the hearing that PC Booth began flirting with her in the town centre before saying he wanted to "meet up on a regular basis to have sex" adding "and if you could get someone else involved it would be even better".
Miss A said she was so shocked by the officer's suggestions that she arranged to meet him later but tipped off his colleagues at West Yorkshire Police.
PC Booth told the panel that he agreed to go to Miss A's flat because she said she did not want to tell him what she knew while he was in uniform with others around.
He said he was shocked when two police officers arrived at the flat, adding "I didn't know what was happening."
Asked by Claire Watson, for West Yorkshire Police professional standards department whether he was in the flat to pursue a sexual relationship with Miss A, he said: "That's not correct. I was there to get some information."
He added: "I was doing my job."
The officer told the panel that, with hindsight, he was "stupid" to go to the flat and said it was "the biggest mistake of my life".
He said he did not tell his supervisors because he wanted to be the "golden boy" bringing in important intelligence.
The hearing in Wakefield heard that PC Booth is married with children and has been a police officer for nine years and was a police community support officer for five years before that.
PC Booth denies all the accusations against him. The hearing continues.