Mongolia alliance opposed to foreign miners posts strong poll gain ULAN BATOR (Reuters) - A left-wing alliance hostile to foreign mining has won more than a fifth of the votes in Mongolia's parliamentary elections, according to a preliminary tally on Saturday, making it a potential coalition partner in the next government. Led by the Mongolian People's Revolutionary Party, or MPRP, the alliance could hold the balance of power in a new parliament after gaining more than 22 percent of votes cast on Thursday, the country's elections commission said. Neither of the two front runners - the Mongolian Democratic Party (MDP) and the Mongolian People's Party (MPP) - had won enough seats to form an outright majority of 39 seats, the preliminary results showed. The MPRP's "justice coalition," headed by controversial ex-president Nambar Enkhbayar, campaigned on a "resource nationalist" platform, calling for the renegotiation of a 2009 agreement that granted 66 percent of the giant Oyu Tolgoi copper-gold deposit to Canada's Ivanhoe Mines. It also wants to keep the coveted Tavan Tolgoi coal project in Mongolian hands. The MDP won 35.32 percent of the total vote, while the MPP gained 31.31 percent. Both parties ran the country in a "grand coalition" that broke down in January. Under Mongolia's new electoral system, 48 parliamentary seats are contested at constituency level on a "first past the post" basis, while the remaining 28 seats are allocated to each party proportionately, depending on their total share of the vote. Although the elections commission did not provide aggregate figures for the number of seats won by each party, Reuters calculations suggest the MDP will be the largest party with 31 seats, eight short of an overall majority. The MPP will control 29 seats while the MPRP-led alliance will gain 11. Still, analysts said both major parties would be wary of a coalition with Enkhbayar, who faces trial on corruption charges, and another MDP-MPP grand coalition remains a possibility. Confusion has been sown since polling stations closed on Thursday over allegations of vote rigging and questions about the reliability of a new electronic voting system. The MDP claimed victory on Friday, saying it had won at least 36 seats and could even be on the verge of gaining absolute control of parliament, known as the Grand Khural. However, nine other parties - including the MPP and the MPRP - later issued a joint statement demanding a full vote recount. People have doubts about the automatic system and counting machines. To clear those doubts, we have to recount all of the votes from the polling stations across the entire country by hand, which is the traditional method," MPP secretary Yangug Sodbaatar told reporters. On Saturday, the elections commission ruled out a recount. Reporting by Maxim Duncan; Writing by David Stanway; Editing by Ed Lane