Mexico City (AFP) - The fiery leftist leading the race for Mexican president, Andres Manuel Lopez Obrador, vowed Friday to hit back at US President Donald Trump if he insults Mexico on Twitter.

"If he makes an offensive tweet, I'm going to take responsibility for answering him," said Lopez Obrador, a former Mexico City mayor who has a double-digit lead in most opinion polls heading into the July 1 election.

"I think (Trump) is going to understand he has to get himself under control, that he can't go around offending the Mexican people. We don't want confrontations with him, but we are going to ask him to respect us," he said at a campaign rally in the town of Huajuapan, in the southern state of Oaxaca.

Trump has regularly attacked Mexico on Twitter since launching his presidential campaign in 2015 by referring to Mexican immigrants as criminals and rapists, and vowing to build a wall on the border.

Mexico's current President Enrique Pena Nieto has rarely answered his counterpart's Twitter outbursts, and his foreign ministry regularly insists Mexico will not discuss diplomatic matters on social media.

Lopez Obrador promised a change in strategy if he wins the election.

The candidate, who is making his third bid at the presidency, is only an occasional tweeter -- though he has increased his use of social media during his campaign.

In April he tweeted to the US president that he wanted to sell him Mexico's presidential plane, a plush Boeing Dreamliner purchased by the previous government of which he is fond of saying, "Not even Trump has a plane like that!"

Lopez Obrador, widely known by his initials, "AMLO," is a divisive figure in Mexico.

But he has ridden discontent with Pena Nieto's government to a firm lead over the second-place candidate, Ricardo Anaya of the conservative National Action Party (PAN), and ruling-party candidate Jose Antonio Meade, a distant third.