The largest public transit project in the nation, a commuter train tunnel under the Hudson River to Manhattan, was halted on Thursday by Gov. Chris Christie of New Jersey because, he said, the state could not afford its share of the project’s rising cost.

Mr. Christie’s decision stunned other government officials and advocates of public transportation because work on the tunnel was under way and $3 billion of federal financing had already been arranged  more money than had been committed to any other transit project in America.

The governor, a Republican, said he decided to withdraw his support for the project on Thursday after hearing from state transportation officials that the project would cost at least $2.5 billion more than its original price of $8.7 billion. He said that New Jersey would have been responsible for the overrun and that he could not put the taxpayers of the state “on what would be a never-ending hook.”

In scrapping the project, Mr. Christie is forfeiting the $3 billion from the federal government and jeopardizing as much from the Port Authority of New York and New Jersey. The state may also have to repay the federal government for its share of the $600 million that has already been spent on the tunnel.