One of Maryland Gov. Martin O’Malley’s (D) most powerful cabinet secretaries is stepping down after nearly three years on the job.

Transportation Secretary Beverley K. Swaim-Staley, the first woman to lead Maryland’s sprawling transportation agency, will leave her post at the end of June, according to O’Malley’s office.

Swaim-Staley has worked for the state for more than 25 years, including previous posts as deputy transportation secretary and overseeing operations at Baltimore-Washington International Thurgood Marshall Airport following Sept. 11, 2001.

Aides said Swaim-Staley surprised O’Malley with her decision late last week. They said the timing of her departure appeared motivated in part by a desire to give the governor time to find a replacement who could lead the agency for the second half of his final term.

Swaim-Staley’s tenure has revolved in large part around funding challenges created by the state’s near bankrupt transportation trust fund.

She was a lead surrogate for O’Malley’s failed attempt this year to convince the state’s General Assembly to apply a 6-percent sales tax to gasoline. And she drew the ire of rural and Republican lawmakers for orchestrating a series of major toll increases to fund needed maintenance and operating expenses for state bridges.

Swaim-Staley also oversaw the completion of the Intercounty Connector and the beginning of greater use of public-private partnerships, in which Maryland has begun to lease state assets to private companies. While some remain mired in legal challenges, a partnership at the Port of Baltimore has been widely credited for creating jobs and readying the port ahead of other East Coast landings for larger ships that will soon be able to pass through the Panama Canal.

“Beverley guided our transportation efforts during the most difficult economic downturn this country has faced in generations,” O’Malley said in a statement. “Despite the economic challenges, we made significant progress including the development of an award winning public-private partnership at the Port of Baltimore and the opening of the Intercounty Connector. I thank her for her years of service.”

Aides said O’Malley would lead a nationwide search for a replacement.

“It has been an honor to serve the citizens of Maryland throughout my professional career,” Swaim-Staley said in a statement. “I chose to make transportation the focus of my government service because I believe it is one of those key areas of government where you can make a positive impact on the lives of citizens across the state. I thank Gov. O’Malley and the citizens of Maryland for this tremendous opportunity. I also thank the thousands of employees throughout MDOT who made our collective progress possible.”

In an apparently unrelated development, Maryland Transportation Authority workers said Monday that they would seek to use a new state law to unionize the agency.