Stephen Timms, Labour MP for East Ham, was stabbed at his constituency surgery in May this year. Photograph: Linda Nylind for the Guardian

A former government minister was the target of an attempted political murder by a woman who wanted to stab him to death as "punishment" for voting for the Iraq war, a court heard today.

Stephen Timms MP, who was a ministers in both the Blair and Brown governments, was stabbed twice in the stomach at his constituency surgery in east London. The attack came on 14 May, days after Labour lost power.

The Old Bailey heard that Roshonara Choudhry, 21, "smiled" just before plunging the knife into the abdomen of Timms, who was saved when an aide grabbed the knife and a security guard put Choudhry in a "bear hug".

She told police during interview under criminal caution that she was intent on stabbing the MP to death, the court heard. Weeks before, she had bought two new knives for the attack, one with a three-inch blade which she used in the stabbing, the other, with a five-inch blade, was kept in her hand bag as back-up in case the first broke during the attack, she told officers.

After her arrest, Choudhry explained she stabbed Timms in the stomach because it was a soft area of the body and she feared being too weak to force the knife into another area.

The Old Bailey jury was told she is not mentally ill and was calm after the attack. She admitted to the police to carrying out the attack and has instructed her defence lawyers not to challenge the prosecution case. The incident was captured on CCTV, stills of which were shown to the court.

Choudhry, the jury was told, does not recognise the jurisdiction of the court.

The jury heard that she had told detectives: "I was not going to stop until somebody made me." Interviewed hours after the attack, Choudhry told officers: "I was trying to kill him."

When the interviewing officer, Detective Inspector Simon Dobinson, asked why, she replied: "Because he wanted to invade Iraq." Asked what that would achieve, she said: "Punishment." She later added: "I was hoping to get revenge for the people of Iraq."

Choudhry, who was not in court today, is accused of attempted murder and two charges of having an offensive weapon.

She took a bus from her East Ham home to Timms's constituents' surgery at the Globe community centre in Beckton, east London. Choudhry asked to see Timms, who is her local MP, rather than his assistant. She then waited for her appointment. She approached the desk where Timms was sat. He told the court he got up, and thought her left hand was outstretched because she wanted to shake hands. He added that Choudhry appeared to be "smiling" and "friendly".

Timms told the jury: "I was a little puzzled because a Muslim woman dressed in that way wouldn't normally be willing to shake a man's hand, still less to take the initiative to do so, but that is what she was doing. She lunged at me with her right hand."

The court heard while her left hand was outstretched, Choudhry used her right hand to stab the former minister. Dobinson said Choudhry told him during the police interview: "I purposefully walked round the side of the desk so I could get close to him. He pointed for me to sit down on the chair but instead I walked towards him with my left hand out as if I wanted to shake his hand."

She thought he had shaken her left hand with his left hand, but she could not remember. Her right hand had been in her pocket.

She continued: "Then I pulled the knife out of my bag and I hit him in the stomach with it. I put it in the top part of his stomach like when you punch someone."

She managed to stab Timms a second time before she was pulled off.

Nigel Tai, the surgeon who operated on Timms, described the injuries he suffered as "potentially life threatening" because of the possible loss of blood and infection had he not been treated.

William Boyce QC, prosecuting, closed the crown's case by telling the jury: "Acting conscientiously in accordance with your oaths you could not come to any verdicts other than guilty on all three counts."

Jeremy Dein QC, for the defence, said: "We have been expressly instructed by Miss Choudhry not to advance any argument nor to act to undermine the prosecution in any way."

The case was adjourned until tomorrow morning when the judge said he would sum up and it is expected the jury will be sent out to consider its verdict.