Indiana became the latest and final state to negotiate a deal with passenger rail provider Amtrak, ensuring that the Hoosier State does not lose service.

The state announced it had come to terms with Amtrak on Tuesday. It faced a Wednesday deadline to get the deal done or face the possibility of service shutdowns.

"This agreement will make Hoosier jobs more secure and preserve an important transportation link for Indiana," Indiana Gov. Mike Pence said in a statement. "I am grateful for the leadership of the Indiana Department of Transportation and the generous support of many of the communities with stops along the Hoosier State line.”

The deal was required as part of a 2008 federal law affecting "state-supported" routes, which run less than 750 miles. Nineteen states enjoyed rail service provided by Amtrak, but states paid Amtrak under different, inconsisstent plans.

Read more transportion stories here.

The 2008 federal law created formulas to bring standardization to that process and more stability to Amtrak's funding.  The affected routes carry more than half of Amtrak's ridership.

States will collectively pay about $85 million extra annually to preserve service on 28 routes.

States will pay for about 85 percent of those routes' costs, which includes the cost of operations, capital maintenance, safety programs and marketing. Amtrak will pay for 15 percent of the costs, funding the "backbone" of the service which includes things like dispatching.

"This has been a long process and one that has produced agreements that are fair and consistent while recognizing the needs of these states and the unique qualities of these routes," Amtrak CEO Joe Boardman said in a statement.

In Indiana, the "Hoosier State" line that runs between Indianapolis and Chicago four days a week is preserved by the deal. Another route running through Indiana, the three-day-a-week "Cardinal" line, continues to operate with federal support because long-distance routes aren't affected by the 2008 law.

The deal struck between Amtrak lasts for one year, with an option for four additional months. Indiana's contribution, about $3 million annually, comes from the state as well as seven cities and counties served by the line. Previously, Indiana didn't contribute anything for the service.

Last week California approved a deal to provide $109 million annually to Amtrak -- up from $90 million last year. Illinois last week announced it had reached a deal with Amtrak to provide up to $37 million this year, an increase of $9 million.

The finalized deals comes at a time when Amtrak is enjoying record ridership. Earlier this year, Amtrak announced its 31.6 million passengers in FY 2013 was its highest total ever. The 15.4 million passengers who rode on "state supported" routes -- those impacted by the new funding agreements -- was also a record high.