LONDON AP – BP Chief Executive John Browne resigned Tuesday, hours after a judge lifted a legal injunction preventing a newspaper from publishing details of his private life and allegations that he misused company resources.

The board named Tony Hayward, the head of exploration and production, as the new CEO effective immediately, BP said. Hayward, who had already been set to take over on Aug. 1, will have to repair BP’s reputation after several high-profile operational and regulatory mishaps tarnished its image.