A Conservative MP’s former chief of staff who is accused of raping a woman in the Houses of Parliament has insisted the sex was consensual, telling a jury he and the woman joked around during the encounter.

Giving evidence in his trial at Southwark crown court on Monday, Samuel Armstrong said he thought the police had the wrong man when they arrested him the day after the alleged rape.

He said he and the woman had ended up alone in the office of his boss, Craig Mackinlay, on the night in question. She asked him to play jazz music and sat with him on a sofa, before jumping up and demanding that he dance with her, Armstrong told the court.

He said they danced in the office and began kissing, before he performed oral sex on her as she sat on the sofa. He told the jury: “She made all the appropriate noises.”

Armstrong, 24, has denied two counts of rape, one of sexual assault and one of assault by penetration. He has been accused of attacking the woman, who cannot be named for legal reasons, after she fell asleep after a night of drinking within the Palace of Westminster on 13 October last year.

Armstrong told the court they had sex for several minutes before the complainant got up to change the music when a “mood-killer” song came on.

“After a little while, she said: ‘Some people are going to think that you have taken advantage of me,’ but it was in a sort of teasing voice. I responded: ‘I’m not sure anyone could come to that conclusion,’” Armstrong said.

He said the woman then sat on top of him and they had sex. “I said to her: ‘How does the size suit the lady?’ which is something I have heard tailors say. And she says the size suits very, very well,” he told the jury.

Armstrong’s barrister, Sarah Forshaw QC, asked him whether the pair were being serious during that conversation. “We were joshing around and being funny. I was being a bit of a prat,” he replied.

Armstrong was arrested after the woman was filmed on CCTV running through the corridors of Westminster in tears.

Describing how he felt when he was arrested, he said: “I didn’t really know what to think. I thought there must have been some sort of mistake. It must have been that they had got the wrong name. It was just like somebody had punched me in the stomach. I was winded.”

He said he regretted having sex in his boss’s office and added that his life had been turned upside down since the allegation was made last year.

“It was foolish. It was an act of enormous foolishness and as a consequence I have had the worst year of my life,” he said.

Armstrong said he had been unable to work or sleep and would “never ever, ever” get his career back. “While what I did is foolish, the point is I’m innocent of this and for whatever reason somebody is trying to make a horrible, horrible, horrible allegation.

“The point is on this allegation, somebody is trying to send me to prison for a very long time for something I didn’t do.”

The trial continues.