The Archbishop of Canterbury, Dr Rowan Williams, spoke at the service and praised the actions and efforts of the troops in Iraq.
But he also said it would take many years to figure out if the invasion was the right or wrong thing to do.
Britain ended its military mission in Iraq in April 2009, after six years of service in the troubled country.
During that time, 179 British soldiers and 55 others were killed in British-led missions.
At one point there were 46,000 members of the British military working in Iraq. Only America had more soldiers there.
British soldiers started fighting in Iraq back in 2003, when troops from lots of different countries worked together to invade the country.
They did that because some world leaders feared that the man in control of Iraq, Saddam Hussein, had very dangerous weapons and was going to use them to attack other countries - including the UK. Those weapons were never found.