(CNN) -- A former British army officer, recently acquitted in Afghanistan on bribery charges, was released from jail Thursday, his lawyer said.
William Shaw had been sentenced in April to two years in Kabul's Pul-e-Charkhi jail but was acquitted Sunday.
He has to stay in the country until July 24 because the prosecution has at least 20 days to appeal. If he were to leave the country before that time, his lawyer, Kimberley Motley, could face punishment.
For a bribery charge under Afghan law, the person who received the money must be a government employee. That was not the case for Shaw, Motley said. He was accused of paying $25,000 to an Afghan intelligence official.
Shaw's employer, security company G4S, authorized him to pay the $25,000 as a good-faith fee to the Afghan intelligence service to have two vehicles released from their custody. The vehicles were released after the payment in October 2009, Motley said.
At the request of G4S, Shaw returned to the intelligence service on several occasions to ask for receipts for the cash, according to his family.
Five months later, he was called to the intelligence service for questioning and arrested. The former military serviceman, who once received a top award from the queen, was sent to the Afghan super-max jail and locked up in solitary confinement.
The Afghan intelligence service had sent two letters to the judges dealing with Shaw's case, informing them the man who took the $25,000 from Shaw was not a government employee, Motley said.