CHICAGO — Illinois has agreed to spend an additional $9 million to support Amtrak service in the state, joining other state governments in bringing a measure of stability to the passenger rail service’s most heavily traveled routes.

The deal was required by a 2008 law passed by Congress that shifts most of the costs for shorter routes from the federal government to states. It affects more than two dozen routes in 19 states that are less than 750 miles. Only Indiana has yet to reach a deal, but it must do so by Wednesday or service along its 196-mile Indianapolis-to-Chicago line will grind to a halt.

In Illinois, signatures were still being gathered Friday, but that state has agreed to pay up to $37 million in the next fiscal year, said Illinois Department of Transportation spokeswoman Jae Miller. That is an increase of about $9 million because of the change in law, she said.

The deals are meant to ensure some states are not paying more than others for comparative service. It also helps align states in a stronger partnership with the federal government, which created the semi-public corporation in the 1970s to take over passenger rail service from private railroads.

“The law in 2008 was a watershed moment for Amtrak,” said Robert Puentes of the Brookings Institution, explaining that until then Amtrak had limped along between annual appropriations from Congress without the certainty needed for long-term improvements.

Republicans in Congress have repeatedly threatened to cut funding, criticizing the service as a money-losing, bloated bureaucracy too dependent on federal subsidies.

Overall, Amtrak expects state support to increase by about $86 million a year as a result of the law. The money will help support shorter routes that a March Brookings report found account for the overwhelming majority of the service’s ridership, which overall has reached 31 million passengers a year.

Illinois was already subsidizing nearly all of its state service on routes from Chicago to Quincy in western Illinois and Carbondale in the southern part of the state, as well as to St. Louis and Milwaukee.

The state is picking up the tab for one additional daily roundtrip on the Chicago-to-St. Louis corridor, where the state is investing heavily to speed up trains to 110 mph with help from President Barack Obama’s high-speed rail initiative.

The issue of greater state support has been more contentious in neighboring Indiana, which will have to put up $3.1 million to keep the Hoosier State line to Chicago running. Some town mayors and others have insisted that any agreement include a commitment by Amtrak to boost the line’s reliability, speed, services and ridership.

Officials there may opt for a short-term agreement to provide additional time for a comprehensive arrangement.

The state deals will undoubtedly lead to more of that kind of scrutiny from local officials, said Richard Harnish, director of the Midwest High Speed Rail Association.

“I think we move into a new phase where those states will be paying more attention to the quality of service and that’s a very good thing,” he said.