Mexico's moderate Finance Minister Carlos Urzua resigned on Tuesday with a letter that shocked markets by citing "extremism" in economic policy, before President Andres Manuel Lopez Obrador quickly named a well-regarded deputy minister to replace him.

In the unusually strongly worded resignation note made public on his Twitter account, Urzua said the government was forming economic policy without sufficient foundation.

"I'm convinced that economic policy should always be evidence-based, careful of potential impacts and free of extremism, either from the right or the left," Urzua wrote.