Combined with its allies, the Institutional Revolutionary Party (PRI) could win between 246 and 263 seats in the 500-member lower chamber of Congress, compared to 251 today, according to estimates by the National Electoral Institute.
The elections, which included races for hundreds of mayors and nine governors, were marred by protests in southern states where radical teachers angry at Pena Nieto's education reforms burned ballot boxes in a failed bid to thwart the midterm vote.
While the PRI and its allies held on to the lower chamber of Congress, a political shockwave loomed in the northern industrial state of Nuevo Leon.
Exit polls showed Jaime Rodriguez Calderon, a foul-mouthed rancher dubbed "El Bronco," will become the first independent candidate to be elected governor since a 2014 electoral reform, riding a wave of discontent against corrupt politicians.
More From This Section
"This will be a citizens' government in Nuevo Leon. Nuevo Leon will be the beginning of a second Mexican revolution," Rodriguez told supporters after a TV Azteca poll gave him a six-point lead over the PRI's candidate.
Pena Nieto's party is expected to win between 29.87 and 30.85 percent of the congressional ballots, slightly less than in the 2012 election, according to the National Electoral Institute.
This would give the PRI between 196 and 203 seats, fewer than the 207 won in 2012. But the Green Party could get 41 to 48 seats while another ally, the New Alliance, would get nine to 12 seats.
"The message at the ballot box is that this government hasn't been bad in the past three years," said Jose Antonio Crespo, political expert at the Economic Research and Teaching Center.
With fewer votes than three years ago, the conservative National Action Party (PAN) would get 105-116 seats, compared to 113 now.
The night's biggest loser was the leftist Democratic Revolution Party (PRD), which would get 51-60 seats, a big drop from 99 today.