James B. Lockhart, the regulator for Fannie Mae (FNM) and Freddie Mac (FRE), is stepping down after a three-year run in the post that reached a climax last fall with the dramatic seizure of the companies.

Lockhart, who heads the Federal Housing Finance Agency, will announce his resignation soon, people familiar with the matter said Wednesday.

A high-school friend of former President George W. Bush, Lockhart was a holdover from the Bush administration, where he also served in top posts in the Social Security Administration.

Lockhart helped establish FHFA as the new regulator for the mortgage giants after its predecessor, the Office of Federal Housing Enterprise Oversight, was phased out by a 2008 housing law that aimed to tighten oversight of Fannie and Freddie.

That effort was unexpectedly accelerated last fall when the FHFA, along with the Treasury Department, threw Fannie and Freddie into conservatorship amid fears the companies would collapse, deepening the global financial crisis.

Lockhart sat alongside Federal Reserve Chairman Ben Bernanke and Treasury Secretary Henry Paulson at FHFA's Washington offices to deliver the news to former Fannie Chief Executive Daniel Mudd and Freddie CEO Richard Syron. The seizure cost both executives their jobs.

Aside from supervising Fannie and Freddie, the FHFA has oversight over the 12 Federal Home Loan Banks.

-By Jessica Holzer, Dow Jones Newswires; 202-862-9228; jessica.holzer@dowjones.com