One of the country’s foremost railway companies will have to ensure cars can use a bridge in Thunder Bay, Ont., under terms of an agreement signed more than a century ago, Ontario’s top court ruled on Monday.

In its decision, the Court of Appeal found a lower court ruling that allowed Canadian National Railway Co. to escape its obligation was unreasonable.

The agreement in question, which dates to 1906, was struck between the Grand Trunk Pacific Railway – now Canadian National – and the Town of Fort William, now incorporated into Thunder Bay. Under the deal, the rail company was to build a “combined railway and highway bridge” over the Kaministiquia River. In return, the town agreed to pay $50,000.

Completed in 1909, the 150-metre bridge was used for rail, vehicle and pedestrian traffic for more than 100 years until 2013, when CN closed it for three days because of a fire. However, CN reopened the span only for rail and pedestrian traffic, not for cars and trucks. The company said motor vehicles could leave the road and end up in the river – something that had never happened in the century of operation.

The bridge, which joins the northern and southern parts of Thunder Bay, is known as the James Street swing bridge. It is a vital route for residents of Thunder Bay and the Fort William First Nation – with thousands of cars and trucks crossing it daily. Without the bridge, vehicles heading to Fort William First Nation have to take a 10-kilometre detour.

Thunder Bay turned to the courts, citing parts of the 1906 contract in which Grand Trunk Pacific promised to give Fort William the “perpetual right” to cross the bridge for rail, vehicle and foot traffic. CN countered that it could not do so safely without making “significant structural changes” that went beyond its contractual obligations, court records show.

In June last year, Superior Court Justice Patrick Smith agreed with CN. Among other things, Smith found the original contract obliged the rail company to maintain the bridge for the type of traffic that existed at the time – essentially streetcars, horse, and cart traffic.

Smith also noted that while CN had maintained the structure for motorized traffic, it always said it had no contractual obligation to do so. He also found that the city had failed to define what changes were needed to make the bridge safe for cars and trucks.

Thunder Bay appealed. In effect, the city argued the 1906 agreement was designed to ensure residents would have the right to cross the bridge by any kind of vehicle, and that CN was obliged to maintain the bridge so that could happen.

In siding with the city, the higher court said Smith made a basic legal error by undermining the importance of the words “perpetual” and “in perpetuity” in the contract.

“CN has a contractual obligation to maintain the bridge for motor vehicles in perpetuity, an obligation it has breached,” the Appeal Court said. “To rectify its breach, CN must reopen the bridge.”

What repairs or upgrades the bridge needs, if any, are for CN to decide, the court ruled.