NEW YORK, JAN. 26 -- Herbert Schmertz, the confrontational public relations director for Mobil Corp., is retiring from the giant oil company to form his own firm and to work as a part-time volunteer for Sen. Robert Dole's presidential campaign.

In his 22 years at Mobil, Schmertz, 57, gained fame not only for spearheading the company's often-combative public stances and newspaper advertisements on the energy crisis and other issues, but also as the driving force behind its influential sponsorship of "Masterpiece Theater" and other major public broadcasting programming.

He also was active outside Mobil, working for the Democratic presidential campaigns of Robert and Edward Kennedy, writing a syndicated newspaper column and public relations textbook and coauthoring a novel.

Mobil announced today that Schmertz, who earned $640,500 from Mobil last year, would leave the company May 1. Schmertz, who also will retire from Mobil's board, is forming his own firm devoted to public relations for corporations and foreign governments. The firm also will produce movies and television programs, but has no current projects under way, he said.

Schmertz said he would work for the Dole campaign on a part-time volunteer basis mainly in fund-raising and nonstrategic areas.

Schmertz became widely known in the 1970s when he oversaw a series of Mobil advertisements on the editorial pages of major newspapers. The columns addressed a range of public issues, and assailed those who opposed Mobil's views.