Susan Marshall, 51, a bursar at Oxford University, said she was offered the job of Crown prosecutor when she was still Simon Stone, but it was withdrawn when she wrote to Dame Barbara Mills, the Director of Public Prosecutions, explaining that she was undergoing treatment to become a woman.
The Crown Prosecution Service had planned to fight in the Court of Appeal the Employment Appeals Tribunal ruling that work equality extends to transsexuals, which allowed Ms Marshall to pursue her claim. But just before the hearing began before Lords Justices Roch, Chadwick and May, the two sides reached an "amicable" and confidential agreement .
Ms Marshall, who had the sex-change operation in 1994 but made the decision to live permanently as a woman two years previously, has said she was "livid" when she was rejected for the job. "I had fondly imagined that a woman who had fought her way up the profession to her position would understand," she has said. "They were very keen to have me and if I was suitable to do the job as a man I could hardly be less suitable as a woman."
She refused to comment yesterday on whether she would be paid damages.
Lawyers for both sides said that the CPS and Dame Barbara had withdrawn their application for leave to appeal and Ms Marshall had in turn withdrawn her claim for sex discrimination, which had been supported by the Equal Opportunities Commission.
A spokesman for the CPS said: "The CPS recognises the distress caused to Ms Marshall by the withdrawal of employment at the time she had expressed an intention to undergo gender reassignment. The CPS accepts that gender reassignment should not have been a bar to Ms Marshall's employment."
He added that the CPS had since installed equal opportunities policies to prevent the same thing happening again.
As Simon Stone, Ms Marshall spent 10 years as a commander in the Royal Navy where she qualified as a barrister in the Chief Naval Judge Advocate's office and served on the Royal Yacht Britannia. In 1988, Mr Stone, who has a wife and two daughters, took over as bursar at Exeter College.