The ministry of defence says the Iranian forces had caught 15 British Navy personnel at gunpoint.
The men were seized at 1030 local time when they boarded a boat in the Gulf, off the coast of Iraq, which they suspected was smuggling cars.
They caught them when they were going on a routine patrol.
Foreign Secretary Margaret Beckett had told the Iranian ambasaddor to look the sailors and marines released as quickly as possible.
In 2004, Iran detained eight British servicemen for three days after they allegedly strayed over the maritime border.