LONDON — Thousands of people in Norway thought they had hit it big in a lottery last week. But what seemed like a stroke of luck didn’t hold: Messages about their winnings had been sent by mistake, according to a state-owned gambling company.

The company, Norsk Tipping, said a coding error had led to notifications about “erroneously high prizes” for the June 27 EuroJackpot, a Europe-wide lottery. It said in a statement that “several thousand” players had been affected, apologizing for the mistake.

“The error was discovered after a short time, but the damage was done,” Norsk Tipping said in a statement Monday that noted the departure of its CEO.

Before leaving the company, CEO Tonje Sagstuen had apologized for giving people “false hopes.”

“We understand of course that this is a breach of trust,” she said of the error, noting that she had received messages from players who had started to plan vacations or buy a home.

Norsk Tipping, which handles the notifications for EuroJackpot in Norway, said it received prize amounts in euros and then converted the figures to Norwegian kroner. The issue came from what Norsk Tipping described as a “manual error” in the conversion code: Instead of dividing amounts by 100, as intended, the code multiplied them by 100, it said in a separate statement.

EuroJackpot did not immediately respond to a request for comment. According to figures on the lottery’s website, the total prize fund for the June 27 draw was about $50 million.

Norsk Tipping did not specify how many customers had been affected by the error or how much they had been told they had won. The company did not immediately respond to a request for further comment.

Sylvia Brustad, the chair of Norsk Tipping, acknowledged that “trust has been broken” and said the company, which has come under heavy criticism from customers and the government, would work to do better.