From remote grasslands to the heart of the capital, Mongolians cast their ballots on Sunday to elect a new president residents and investors hope will facilitate the country's efforts to tap its vast mineral wealth.

The tight race between incumbent Nambariin Enkhbayar of the ruling Mongolian People's Revolutionary Party (MPRP) and opposition Democratic Party (DP) candidate Tsakhiagiin Elbegdorj is seen as a barometer of how soon the country will be able to reach a deal with foreign investors on a landmark mining deal.

Any repeat of the type of unrest and ensuing legal struggles that followed last year's parliamentary elections, in which five died, could postpone approval of a draft investment agreement on developing the pivotal Oyu Tolgoi copper and gold project.

It's a beautiful day today, and I hope it's also going to be a very good election. I firmly believe in the bright future of our people and the prosperity of our country, Enkhbayar said after voting in a university gymnasium in the capital Ulan Bator.

Coming at a time when the young Central Asian democracy has been hit hard by falling mineral prices, the election pits Enkhbayar's pledge to beef up the rule of law against Elbegdorj's promises of change and fighting corruption. Both are dangling payouts from mining revenues and further help for students.

The most important thing the new president needs to do is develop the country, to pull us out of poverty, said Davaadorjiin Suvdaa, a 56-year-old retired worker.

A win by Elbegdorj could complicate policy making on mining, given his track record of anti-foreign and populist inclinations, analysts say.

Voters turned out in droves in the capital, many dressed in traditional long silk cloaks known as deels, in a sign of their respect for the largely ceremonial head of state and symbol of national unity.

Polling stations close at 10 p.m. (10:00 a.m. EDT) and the latest survey put the two parties in a statistical tie. A result could be known later on Sunday or early Monday but it also could take several days if it is a tight race.

SEEKING STABILITY

In the country's vast windswept grasslands, many nomadic herders traveled dozens of kilometers on horseback and motorbike to the nearest polling stations.

Stability is the most important thing to me, said Sandagyn Bayarmaa, 46, who lives with her husband in a round felt tent and herds goats and sheep like much of the population.

The countryside is the traditional base of support for the MPRP, the reincarnation of the party that ran Mongolia as a Soviet satellite through much of the last century, while Elbegdorj draws largely on urban voters.

Exit polls are banned, but if voter turnout is high, meaning around 80 percent, that will probably bode well for challenger Elbegdorj, said Luvsandendev Sumati, director of the Sant Maral Foundation, a group that does polling and surveys.

What might change the election outcome is only feet, Sumati said. The MPRP and their candidates were always better organized so their supporters are voting in an organized manner. But Democratic Party supporters, they are rather those who think, 'Well, should I go or not?'

Mongolia, whose empire under Genghis Khan once extended west as far as Hungary, now faces the imperative of uniting on what terms it can accept in working with foreign miners to develop the deposits of copper, gold, uranium, lead, zinc, and coal that it hopes will pull its nearly 3 million people out of poverty.

Negotiations over the $3 billion Oyu Tolgoi project, set to be developed by Ivanhoe Mines and Rio Tinto, have dragged on for years as the government seeks to formulate it as a model for obtaining sufficient revenue from its mineral resources in future.

Sealing the deal quickly is increasingly important if Mongolia hopes to realize its ambitions of becoming a mining powerhouse and take advantage of the next upturn in commodity prices, analysts say.

(Additional reporting by Reuters Television; Editing by Ken Wills and Paul Tait)