PORTLAND, Maine — The federal border protection agency plans to close its operations at Portland’s international ferry terminal, a move that would effectively end The Cat ferry service between Canada and Maine’s largest city.

U.S. Customs and Border Protection doesn’t plan to provide entry and exit screenings at the Ocean Gateway terminal next year because the facility doesn’t meet federal standards necessary to ensure the safety of its officers and passengers on the Portland-Nova Scotia ferry, an agency spokesman said. Federal law requires people entering the country go through customs screening.

The city has been trying to find a compromise that will let the ferry come back to Portland for the 2018 summer season, but will not spend millions of taxpayer dollars on upgrades or a new facility for the federal agency, City Manager Jon Jennings told the Bangor Daily News.

“The city cannot shoulder the burden of the anywhere between $6 million to $7 million new facility that customs requires,” Jennings said. “We find ourselves in a very difficult situation because we would obviously like to continue to have the ferry in the city, but it can’t be exclusively on the backs of the Portland taxpayers.”

Customs and Border Protection, however, contends that it is up to Portland, as the owner of the Ocean Gateway terminal, to provide an adequate facility.

“Currently, as there are no plans to provide CBP with a fully compliant facility, we are unable to continue to provide service beyond the 2017 ferry season at this location as we must maintain the highest level of national security at all of our ports of entry,” spokesman Sean Smith said.

The dispute over how to pay for millions of dollars worth of work could sink Bay Ferries Ltd.’s 2018 season, even as the Canadian company has begun to rebuild ridership that was low even before the ferry’s previous operator went out of business and had its ship seized in 2015.

Local officials have been working with Bay Ferries and the federal government to put together a plan for preliminary upgrades to the Ocean Gateway terminal. But with six months to go before The Cat is scheduled to return to Portland, it is unclear whether it will have a functional port of entry into the United States.

The need for upgrades at the terminal date back to 2014, when Nova Star Cruises restored ferry service between Portland and Yarmouth, Nova Scotia. A ferry had last regularly sailed that route in 2004.

The Ocean Gateway terminal was built before the U.S.-Canadian border was hardened after the Sept. 11 terrorist attacks, and when the Nova Star began operations, Customs and Border Protection informed the city that the facility did not meet its new standards.

Nonetheless, “in an effort to support local economic growth,” the agency agreed to provide interim service and give the city time to plan for upgrades or a new terminal, Smith said.

Jennings said that the city never planned to cover the full cost of a new facility for Customs and Border Protection, but that federal money to support the project also never materialized. The City Council recently agreed that the full funds cannot come from local coffers, he said.

City staff “have been doing everything humanly possible” to find a way to bring The Cat back to Portland next year, and they have reached out to Maine’s congressional delegation for support, Jennings said.

Customs and Border Protection declined to say what work is needed at the Portland terminal, citing security concerns. City officials said the agency’s requests include a new office building, holding cells, radiation detectors, and equipment to read the license plates of cars and trucks disembarking from the ferry.

The city plans to present the agency with an interim plan for $1 million to $2 million worth of upgrades as soon as possible, Jennings said.

Over this past ferry season, Bay Ferries paid Portland more than in $190,000 in rent and fees, and carried more than 41,000 passengers in and out of the city.

Ridership is up from Bay Ferries’ first season back at the helm last year, and the company is also looking at restoring ferry service to Bar Harbor.

The company, which is heavily subsidized by the Nova Scotian government, did not respond to requests for comment Friday evening.

Follow Jake Bleiberg on Twitter: @JZBleiberg.

Follow the Bangor Daily News on Facebook for the latest Maine news.