MTA Chairman Tom Prendergast will be retiring within several weeks.

One day after opening the Second Avenue subway, Prendergast announced his decision in a joint statement with Governor Andrew Cuomo Monday.

“It’s never easy to leave an organization after 25 years of service, but I do so knowing that the MTA will continue to serve the public so well and that our Governor will ensure New York continues to have the most robust transportation system in the country,” Prendergast said.

“Opening the Second Avenue Subway this weekend was a crowning achievement for the MTA and I’m proud to have been a part of such a historic moment,” he continued. “It has not only changed the daily commute for hundreds of thousands of customers, it has helped change the face of the MTA — showing the public we can meet the deadlines we set for ourselves.”

Prendergast is expected to depart soon. Cuomo at an unrelated event Monday said that the agency had “several weeks” to find Prendergast’s replacement.

“Tom has been an incredibly effective chairman and CEO and among the finest public servants I have had the privilege of working with,” said Cuomo, who oversees the state-run agency. “I thank him for his hard work and dedication to the people of New York, and wish him and his family the best on this exciting new chapter.”

Ronnie Hakim, the current president of New York City Transit, has been rumored to be among the candidates to replace Prendergast, according to a source. Spokespeople for the governor and the MTA declined to discuss speculated potential choices.

Prendergast, 64, came aboard as chairman and CEO in 2013. But he has worked for the agency for more than two decades, filling such roles as the president of NYC Transit and president of the Long Island Railroad.

Upon appointment as chairman, Prendergast made clear to Cuomo that he had only wanted the job for approximately three years. In that time, Prendergast has established himself as a technocratic leader with a firm grasp on the inner workings of the agency.

“From car type to the width of the rail — Tom really understood the system,” said Andrew Albert, an MTA board member. “I’m sorry to hear that he will be leaving. It’s real loss for the MTA.”

The past two years have been especially eventful for the MTA and Prendergast, who had to work with feuding city and state governments to secure funding for the agency’s five-year capital budget, walk the public through the impending L train shutdown, and see out the Second Avenue subway project.

Cuomo mentioned Monday that he doesn’t think he’ll “find another Tom Prendergast,” but said the chairman’s replacement should have some background in development.

“We’re building on the LIRR, Penn Station, Farley Station,” Cuomo said. “It’s a difficult mix of talents.”

Staten Island Borough President James Oddo in a Twitter post called the chairman a “gentleman and a pro.”

Veronica Vanterpool, the executive director of the Tri-State Transportation Campaign and an MTA board member, said that Prendergast was by far the most receptive chairman to advocates that she has seen in the past decade.

“He brought the advocacy community to the table in ways that his predecessors did not. He wanted a good relationship and built a strong rapport.” Vanterpool said. “That meant a lot to us and helped foster a level of respect for him.”