Canadian Pacific Railway Ltd said on Monday it had scrapped efforts to buy Norfolk Southern Corp, almost six months after it launched its unsolicited $28 billion bid for the fourth-largest U.S. railroad operator.

The announcement comes days after the U.S. Justice Department urged the Surface Transportation Board to reject a voting trust arrangement Canadian Pacific Railway had proposed as part of its bid.

Calgary-based CP, Canada's second-largest railroad operator, launched its takeover bid for Norfolk Southern in mid-November, touting potential savings of more than $1.8 billion annually.

But Virginia-based Norfolk Southern had continually rebuffed its advances, rejecting CP's offer three times including its latest offer in December.

In that offer, CP had proposed a contingent value right in a new holding company for CP and Norfolk Southern that could have increased the value of the deal by up to $3.4 billion.

Norfolk Southern's shares were down about 0.8 percent at $80.82 in premarket trading. CP's U.S.-listed shares were untraded before the opening bell.

"We have long recognized that consolidation is necessary for the North American rail industry to meet the demands of a growing economy, but with no clear path to a friendly merger at this time, we will turn all of our focus and energy to serving our customers and creating long term value for CP shareholders," CP Chief Executive Hunter Harrison said in a statement.

A number of Democratic lawmakers in Congress, including all the party's representatives from Illinois and Pennsylvania, have spoken out against a merger.

The U.S. military also raised concerns last week, saying a merger could adversely affect the country's national defense. The military relies on rail networks to move defense-related cargo across the country, both during peace and times of war.

Some customers including package delivery companies FedEx Corp and United Parcel Service Inc had also opposed CP's plans out of fears that cost cutting would hurt rail services. UPS is the largest customer of the major U.S. railroads.

Billionaire investor William Ackman had played an outsized role in CP's plan to buy rival Norfolk, but later acknowledged that his firm, Pershing Square Capital Management, should have cut its stake in CP.

CP had also discussed a deal with CSX Corp last year but could not reach an agreement.

Norfolk Southern's shares have fallen more than 6 percent since CP's first offer in November.