Mayor Sam Adams' gambit to save the YouthPass has worked.

Three weeks after the mayor threatened to raise the transit agency's bus-shelter fees by $2 million unless it agreed to restore free bus and train rides for Portland Public Schools students, the city has brokered a deal.

The cost is split three ways: The city will pay TriMet $200,000, and Portland Public Schools will pay $950,000. TriMet swallows $1.75 million in lost revenue to its general fund.

Perhaps the biggest coup: The deal apparently involves no service cuts.

"TriMet is a top-tier transit agency and a valuable community partner," Adams said in a statement. "I am grateful for their collaboration to ensure that Portland Public's high school students get to class, activities and jobs—and most importantly, graduate from high school on time. This next generation of TriMet riders thanks them as well."

Both Adams and TriMet general manager Neil McFarlane are on vacation, and could not be reached for further comment.

The deal comes exactly a week after an arbitrator took some financial pressure off TriMet by ruling for the agency in its contract dispute with its employee union. 

UPDATE, 2:30 pm: TriMet spokeswoman Mary Fetsch tells WW that the transit agency will offset the $1.75 million in lost revenues by gauging internal efficiencies in its new fiscal year—"programs coming in under budget, that sort of thing." She says all three parties will seek other funding together—and will probably look to the state.

Read the agreement here.