A city council has voted to drop its own energy company at a cost of up to £3.5m.
Liberal Democrat-run Portsmouth City Council made the decision at a special cabinet meeting.
Leader Gerald Vernon-Jackson previously said Victory Energy would need to sign up more than half of the city's households to break even.
The meeting heard abandoning the firm would cost at least £2.5m, but losses would be greater if it continued.
The council's previous Conservative administration approved the contract to set it up, but it was yet to go into operation.
At the time, it was claimed the company could generate up to £5m annual profit after the initial investment of £8.1m.
However, an independent report by PricewaterhouseCoopers said that was depended on 144,000 customers signing up.
It added the council would have had to invest £19m over four years.
Abandoning the project could cost between £2.5m and £3.5m, Mr Vernon-Jackson confirmed.
He said: "The decision we have made is to limit the risk of losing millions of pounds of public money.
"It's a very difficult decision but we have decided it's not the right thing for a council like us to be doing. It's too risky."