DUBAI (Reuters) - Yemen's government will attend U.N.-sponsored talks with the Houthis and their allies, a government spokesperson said on Sunday, in a fresh bid to end months of fighting that has killed more than 5,000 people.

The Saudi-backed government said on Saturday it had been studying an invitation from the United Nations to attend a new round of talks in an undisclosed location.

"The decision has been taken to attend (the talks) and a letter will be sent to the U.N. secretary-general (about that)," Rajeh Badi, the government spokesman, told Reuters.

U.N. special envoy to Yemen Ismail Ould Cheikh Ahmed has been in Saudi Arabia for discussions with Yemeni President Abd-Rabbu Mansour Hadi and other senior Yemeni officials over the talks.

A previous round of U.N.-sponsored talks in Geneva between the Yemeni government and the Houthis in June failed to achieve a breakthrough.

At least 5,400 people have been killed in the fighting in the poorest country on the Arabian Peninsula, and the United Nations says the humanitarian situation, exacerbated by a Saudi blockade of Yemen's ports, is "critical".

Saudi Arabia has been leading an Arab military intervention since March to try to restore Hadi's government, now based in Aden, and fend off what it sees as creeping Iranian influence.

(Reporting by Sami Aboudi; Writing by Hadeel Al Sayegh; Editing by Mark Potter)