Target said Thursday it will exit the Canada market, a recent expansion that has resulted in billions of losses and a move that will lead the retailer to book a massive $5.4 billion charge in the fourth quarter to reflect the loss from the investment.

The exit from Canada comes after Target TGT moved aggressively to open over a hundred stores quickly in the market, but was criticized almost immediately for doing a poor job of replicating its American shopping experience. Though sales have been rising, the division remained deeply unprofitable.

“Personally, this was a very difficult decision, but it was the right decision for our company,” said CEO Brian Cornell. Cornell joined Target last year and wasted almost no time in angling to fix the retailer’s woes in Canada, flying up to that nation during his first week on the job as he aimed to learn as much as he could about the business before the latest holiday season.

But Target has decided it will fully retreat from the market, a move that signals the retailer’s top executives couldn’t justify further investing in the business with the hopes of eventually making money. In fact, Cornell said the company was unable to see a realistic scenario that would have gotten Target Canada to profitability until “at least 2021.”

The move, while likely to catch many on Wall Street off guard, has clear justification. Though sales for the first nine months of fiscal 2014 leapt 90% to $1.32 billion, the segment’s loss swelled to $627 million for earnings before interest and taxes. Losses for the business totaled $941 million in 2013, $369 million in 2012 and $122 million in 2011. With that business mired in the red, Target’s overall profitability was severely challenged.

Target Canada has 133 stores across the country and employs about 17,600 people. The stores will remain open during the retailer’s liquidation process. As a result of the move, Target is expected to report about $5.4 billion of pre-tax losses on discontinued operations for the fourth quarter of 2014, driven primarily by write-downs for the company’s investment, along with costs associated with the exit from that market. Cash costs to discontinue the Canadian operations will be $500 million to $600 million, most of which will occur in the company’s fiscal 2015 or later.

As a result of the move, Target will turn all focus to the U.S. market, where sales have been rising, albeit modestly as the retailer faces stiff competition for a slice of consumer spending.

Fortune retail reporter Phil Wahba took a look at several reasons why Target failed in Canada. That story can be found here.