The clock is ticking for Tesla Inc. after it agreed to build the world's largest lithium-ion battery park in South Australia, signing off on a deal to finish the instillation within 100 days or give it away for free.

The deal follows a call for tenders by the Australian state, which has suffered a series of devastating blackout that have left as many as 1.7 million people without power.

Tesla is marked more than 2% higher in Friday premarket trading, with shares expected to open at $315.26. Tesla has lost 19% of its value over the past five days, it closed 5.58% down at $308.83 on Thursday.

Tesla's billionaire founder Elon Musk in March tweeted that he could help solve the state's power issues by building 100MW of storage capacity within 100 days of signing a deal, adding the surprising promise to deliver it on time or hand it over for nothing.

Musk was back on twitter again on Friday to boast about the new project declaring: "This will be the highest power battery system in the world by a factor of 3. Australia rocks!!"

This will be the highest power battery system in the world by a factor of 3. Australia rocks!! https://t.co/c1DD7xtC90

— Elon Musk (@elonmusk) July 7, 2017

Musk on Friday, July 7, confirmed that the 100-day pledge was part of the agreement and said the park would be in place by the start of December. Failure to deliver the project on time would cost his company about $50 million, said Musk, though neither the state government nor Tesla released details of the contract.

The battery 100 MW/129 MWh park is a key part of South Australia's $550 million plan to overhaul its failing energy grid, which has struggled to cope with increased demand during peak periods, while some legislators have also blamed the state's high level of renewable energy for the problems.

The battery park will be paired with a wind farm operated by France's Neoen Energy SA, which will supply power that will be stored in the Tesla batteries for redistribution into the power grid during peak periods of demand or when supply from South Australia's wind farms dip.

"This grid scale energy storage project is not only sustainable, but will help solve power shortages, reduce intermittencies, and manage summertime peak load to improve the reliability of South Australia's electrical infrastructure," said Tesla.

The deal caps an otherwise tough week for Tesla and Musk, who on Sunday said that Tesla car deliveries would undershoot analyst expectations in the second quarter due to battery shortages. Then on Thursday, the company's Model S was left off the Insurance Institute for Highway Safety's influential "Top Safety Pick+" list of safest cars.

Watch more Tesla news on TheStreet:

Visit here for the latest business headlines.