AMSTERDAM, Jan 12 (Reuters) - The Dutch government will provide 20-25 billion euros ($22-27 billion) to grid operator TenneT to ensure it can continue investing in the energy transition while the sale of its German arm is delayed, a source close to the matter told Reuters.

The source, confirming an earlier report by Dutch newspaper NRC, said the money could be used for investments in power grids in both the Netherlands and Germany.

The company can withdraw money from the pot until the sale of the German division is completed, which is expected to bring in between 20 and 25 billion euros, but will eventually have to pay back the Dutch government, the source added.

State-owned TenneT operates the Dutch high-voltage grid and part of the German grid, and is key in the energy transition away from fossil fuels amid increasing demand for electricity.

The German government is still planning to buy TenneT's business in Germany but the plan hit a hurdle after the country's constitutional court ruled that unused COVID-19 pandemic funds could not be re-used for climate projects.

TenneT did not immediately respond to a request for comment.

($1 = 0.9121 euros) (Reporting by Charlotte Van Campenhout Editing by Mark Potter)