Michael Adebolajo gave evidence at the Old Bailey, surrounded by five security guards.
He and Michael Adebowale, 22, are accused of murdering Fusilier Rigby by running him down with a car and then hacking him to death with a meat cleaver and knives near Woolwich Barracks in south east London on May 22.
The soldier’s relatives sat feet away as Adebolajo, a married father-of-six, spoke to the court.
Fusilier Rigby’s widow Rebecca left the courtroom in tears as Adebolajo claimed the 25-year-old soldier was still moving after he was hit by the car. Asked who al-Qaida were by his counsel, David Gottlieb, Adebolajo replied: “Al-Qaida, I consider to be Mujahideen. I love them, they’re my brothers. I have never met them. I consider them my brothers in Islam.”
The 28-year-old, whose front teeth are missing, told the jury that he does not regret what happened to Fusilier Rigby.
He said: “I will never regret obeying the command of Allah. That is all I can say. I’m a mujahid, I’m a soldier, I’m doing what Allah commands me to do. I can’t do anything else.”
But when he was asked how he felt towards the soldier’s family, he told the court: “I have no animosity or bad feelings towards them. Every soldier has a family, has a family who loves him just like me.
“My family didn’t stop loving me the moment I became a soldier.”
Adebolajo, dressed in a black Islamic tunic, went on: “That soldier’s life, his death might protect the lives of other soldiers who are being sent to die in unjust wars.”
When asked what his defence to the charge of murder was, Adebolajo insisted that he was a soldier. “I’m a soldier. I’m a soldier of Allah and I understand that some people might not recognise this because we do not wear fatigues and we do not go to the Brecon Beacons and train and this sort of thing.”
Asked what should happen to him after this case, he said he should be ransomed back to other jihadi fighters, set free or killed if he is found guilty.
The jury heard that he took the name Mujahid, meaning fighter, after he converted to Islam in 2002 or 2003. “When a soldier joins the Army he perhaps has in his head an understanding that he will kill a man at some stage. When I became a mujahid I was aware that perhaps I might end up killing a soldier.”
In 2010 he tried to travel to Somalia but was captured in Kenya and brought back to the UK.
He told the jury that he and Adebowale prayed to Allah that they would attack a soldier and not a civilian.
“To be 100 per cent, I don’t believe there’s a way to know 100 per cent that was a soldier; however there were some steps that we took. For example before we started out on that day and the night previous to that I started worshipping Allah and begging him that ... we strike a soldier and a soldier only.”
Adebolajo said he asked people at the scene to film him to “make it clear to everybody why the soldier lost his life” and “how this can be avoided in the future”.
He said he converted to Islam in his first year at Greenwich University, but was raised as a Christian.
In cross-examination by prosecutor Richard Whittam QC, Adebolajo admitted that he and Adebowale had killed Fusilier Rigby in a “military operation”.
As well as murder, Adebolajo and Adebowale are both accused of attempted murder of a police officer and conspiracy to murder a police officer, which they deny.
The trial continues.