Soaring temperatures may have caused the deaths of two servicemen while training in some of Wales' most rugged terrain, military sources say.

The men had been on an exercise in the Brecon Beacons yesterday - where temperatures topped 29.5C (85.1F) - before they died.

A third serviceman was taken to hospital and remains in a serious condition.

The Ministry of Defence and police said they were both investigating the incidents, which happened near the Storey Arms Centre.

A spokesman said: "The MoD can confirm that it is working with Dyfed Powys Police to investigate an incident during a training exercise on the Brecon Beacons on Saturday in which two members of military personnel died.

"The two servicemen's next of kin have been informed."

The Brecon Beacons is one of several locations British military use as part of their training.

Its rugged and sprawling terrain helps prepare soldiers physically and mentally for warfare as well as put their logistic skills to the test, making it an ideal area for elite forces personnel like the SAS.

However the Beacons' jagged topography can prove dangerous even to the most hardened and physically fit.

Earlier this year an army captain was found dead on a snow-covered Corn Du mountain. It was thought that Rob Carnegie had been taking part in a gruelling 17-40 mile march in freezing conditions in the Brecon Beacons as part of a selection process for the special forces regiment, when he collapsed and died.

However, this time investigators are examining whether hot temperatures played a major factor.

A source said: "It is a case of the people succumbing to being affected by the training that they were doing."

The Army's website said the Brecon Beacons were used because they are so demanding and prepare soldiers for the "extraordinary things" they have to do on deployment.

The website says: "Training for high-intensity, light-role war fighting is the way soldiers and officers are prepared for any operational situation they may face - conventional war, counter insurgency, security sector reform, peacekeeping or supporting civil authorities.

"This ensures that the training is as close to current operations and pre-deployment training as possible, whilst maintaining the ability to train for high intensity war fighting."

Major Alan Davies, who was involved in contingency planning during the first Gulf War, told the BBC that the Beacons is one the most challenging terrains military personnel can encounter.

"On one end of the spectrum you have cadets being taken for mountain walking and at the other end of the spectrum the SAS use it," he said.

He added that the three men may have been carrying very heavy equipment and working to a deadline, which meant they would have been pushing themselves very hard.

News of the deaths has been met with shock in the nearby town of Brecon, which is home to The Infantry Battle School (IBS)

Brecon mayor and Powys county councillor Matthew Dorrance said: "It's incredibly sad for the friends and family of the people who have lost their lives and our thoughts are with the person who is injured.

"In one way we've been blessed with the weather but for people working in this heat, they're tough conditions."

Mr Dorrance added that locals regularly saw troops training in the area.

"We're proud of our links with the military in the town," he said.

A Dyfed Powys Police spokesman said: "The Ministry of Defence are fully co-operating with our inquiries.

"The next of kin and HM coroner have both been informed. "