DUBAI, Nov 27 (Reuters) - Spain and Qatar hope to sign early next year an agreement to form a $1 billion joint investment fund that would help the Gulf state invest in Latin America, the Spanish ambassador was quoted by a Qatari newspaper as saying on Sunday.

Negotiations on the agreement have been stalled for almost a year by political uncertainty in Spain, but could resume once a new minister of trade has been appointed, Ignacio Escobar said, according to the interview with Gulf Times.

Mariano Rajoy was sworn in for a second term as Spain's prime minister on Oct. 31, giving the country a fully functioning government for the first time in 10 months after two inconclusive elections and fruitless coalition talks. urn:newsml:reuters.com:*:nL8N1D13P1

Officials hope, Escobar said, that the investment deal can be signed during a high-level visit to Qatar by Spanish officials in the "first semester of 2017".

"This is very interesting for Qatar because the QIA (Qatar Investment Authority) has said many times that they want to invest in Latin America," Escobar said, in reference to the Gulf state's sovereign wealth fund.

"It is a new market for them and it is full of opportunities, and Spain is the perfect gateway for Latin America."

The QIA has in recent years been seeking to diversify its portfolio away from European assets, announcing in 2014 it would put $20 billion into Asia. In September 2015, the QIA said it would be involved in Qatari plans to invest $35 billion in the United States.

Hassad Food, the agricultural arm of Qatar's sovereign wealth fund, said in February 2015 it was looking at possible purchases of Brazilian sugar and poultry assets, although its website does not list any investments on the continent.

(Reporting by David French: Editing by Andrew Torchia) ((davidj.french@thomsonreuters.com; +971 4 362 5864; Reuters Messaging: davidj.french.thomsonreuters.com@reuters.net))