In a statement, Browne said: "In my 41 years with BP I have kept my private life separate from my business life.
"I have always regarded my sexuality as a personal matter, to be kept private.
"It is a matter of deep disappointment that a newspaper group has now decided that allegations about my personal life should be made public."
Browne joined the company in 1966 as an apprentice and worked his way up, taking the top job in 1995.
He oversaw BP's expansion into the US, including the 1998 merger with Amoco and the subsequent acquisitions of Arco and Castrol.
After more than a decade at the helm of BP, he had announced in January that he would resign at the end of July, bringing his expected departure forward by more than a year.
He will be succeeded by his designated successor Tony Hayward, the company said. Shares in BP closed 0.4 per cent lower at 563 pence on Tuesday.
In Tuesday's statement, Browne said he had had a four-year relationship with Jeff Chevalier, a Canadian citizen, who had told his story to Associated Newspapers, publishers of the Daily Mail, Mail on Sunday and Evening Standard.
He did acknowledge in a personal statement that he had lied in his initial witness statement about how he met Chevalier.
While he had quickly retracted this "untruth", a BP source said it was this that made him feel compelled to resign.
Justice David Eady told the high court he had taken into consideration Browne's admission he had lied for his decision after a legal battle that had lasted four months in private.
Eady said: "I am not prepared to make allowances for a 'white lie' told to the court in circumstances such as these."
Browne said allegations in court documents disclosed on Tuesday were "full of misleading and erroneous claims.
"In particular, I deny categorically any allegations of improper conduct relating to BP."
Peter Sutherland, the BP chairman, said Browne had told the company of allegations over the limited use by Chevalier of BP computer and staff resources.
"At John's explicit request, the board instigated a review of the evidence. That review concluded that the allegations of misuse of company assets and resources were unfounded or insubstantive," Sutherland said in the statement.
Browne been considered an architect of the transformation of BP from a run-of-the-mill European oil company into one of the world's biggest oil corporations in the league of Royal Dutch Shell.
Analysts say he began a trend of buying up the stock of rivals on Wall Street and was among the first enter the Russian market after the end of communism.
His decisions set the trend for the mega-mergers of the oil industry in the 1990s which made BP one of the biggest oil companies in America.
Later, Exxon went on to buy Mobil and Chevron bought Texaco.
But Browne's attempts to fashion BP as an environmentally friendly oil company - he was the first major oil company CEO to acknowledge global warming and masterminded BP's logo change from a shield to a flowerlike sunburst design with the slogan "Beyond Petroleum" - were undermined by the company's recent US troubles.
BP was forced to temporarily close some of its operations at the Prudhoe Bay oil field in Alaska because of a major pipeline spill and delayed the opening of its key Thunder Horse platform in the Gulf of Mexico.
The 2005 explosion at its Texas refinery that killed 15 workers has so far cost the company around $2bn in compensation payouts, repairs and lost profits.
As well as losing his agreed entitlement to a year's notice including a bonus of up to 1.3 times his annual salary, worth more than 3.5m pounds ($7m), Browne also foregoes inclusion in a long-term performance share plan with a maximum potential value of some 12m pounds.
Browne is also expected to leave the board of US investment bank Goldman Sachs Group, where he has been a director since 1999, a source familiar with the matter said on Tuesday.
Goldman Sachs declined to comment.