CAPE TOWN (Reuters) - French oil major TotalEnergies has notified South Africa's petroleum regulator that it intends to withdraw from its 11B/12B offshore gas field but has yet to submit a formal request to do so, a source at Petroleum Agency SA said.

TotalEnergies discovered the first of two large mainly gas finds in Block 11B/12B offshore the southern coast in 2019, and the withdrawal is a setback for South Africa which was banking on the gas potentially supplying an idle national gas-to-liquid refinery at Mossel Bay.

Talks over the gas price have stalled for years, while TotalEnergies has invested heavily to explore neighbouring Namibia, a global exploration hotspot since TotalEnergies, Shell and Galp hit new finds.

"The main reason (for the withdrawal) is the inability to secure a market for the gas," the source told Reuters on Tuesday.

"They have not withdrawn their production right application (to 11B/12B)," added the source, who was not authorised to speak to the media.

TotalEnergies did not respond immediately to a request for comment.

Bloomberg reported the news earlier on Tuesday.

TotalEnergies partnered with QatarEnergy in March to buy a stake in a licence seeking oil and gas on the west coast of South Africa as part of plans to develop the Orange Basin in Namibia.

The prolific Orange Basin, where most of Namibia's petroleum finds have been made, extends southwards into South African waters.

(Reporting by Wendell Roelf and America Hernandez; Editing by Emelia Sithole-Matarise)