When Tesla Motors paid off its $451.8 million US government loan four years early, the Silicon Valley company gave a boost to the Obama administration’s much-maligned program to jumpstart the electric car industry. But the payback comes with a financial cost to the US: The government gave up warrants to buy Tesla stock currently worth $270 million.

Tesla had issued the warrants to the US Department of Energy as part of a $465 million loan agreement that helped finance production of its Model S luxury sports sedan. The warrants helped hedge the risk to taxpayers and gave them a potential payoff if Tesla proved a success rather than a Fisker-like failure.

That stake has soared as Tesla turned in its first profitable quarter, and the Model S continues to garner rave reviews from the likes of Consumer Reports, which declared it the best car the magazine had ever tested on the road. At the close of the market yesterday, the government’s warrants to buy 3 million Tesla shares would have netted taxpayers a profit of about $248 million. Of course, if Tesla stumbled in the years ahead, those warrants also might have been worthless.

The terms of the original loan agreement required Tesla to pay off the loan by 2022 and gave the government the right to exercise the warrants between 2018 and 2023. But in March, Tesla renegotiated the deal and agreed to pay back the loan by 2017, according to its financial filings. The government in turn agreed not to exercise the warrants if Tesla paid off the loan early.

By wiring the government $451.8 million yesterday from the proceeds of a billion-dollar sale of stock and convertible notes, Tesla voided not only that obligation and the political scrutiny that comes with being the recipient of government largesse. The company is now also free from restrictions the government placed on Tesla, such as limiting capital expenditures and requiring chief executive Elon Musk to own a certain amount of stock.