Secretary of State John F. Kerry warned on Wednesday that patience with Venezuela’s government is wearing thin, and he raised the possibility of sanctions against the South American country if the process of political reconciliation does not move forward.

During his first trip to Mexico as secretary of state, Kerry spoke most forcefully about the political crisis in Venezuela, where an attempt by South American countries and the Vatican to mediate a dispute between President Nicolás Maduro and the opposition has stalled. Maduro’s government has been escalating its crackdown on anti-government protesters, leading to allegations of abuse and torture by government security forces.

“Our hope is that sanctions will not be necessary. Our hope is that we can move in the direction of a reconciliation and a political path forward,” Kerry said during a news conference here. But Congress is discussing the sanctions, Kerry said, and it is up to Maduro and others to “make the decisions that will make it unnecessary” for sanctions to be imposed.

Kerry said that “regrettably there has just been a total failure by the government of Venezuela” to act in good faith. “What is important for the Venezuelan government now is to honor the dialogue process, and to restore the civil liberties of opposition leaders who have been unjustly imprisoned,” he said.

Maduro this week described a vote by the Senate Foreign Relations Committee to impose a visa ban on and freeze assets of certain Venezuelan officials as “detestable.”

Kerry arrived in Mexico City on Wednesday morning and met with Mexican Foreign Secretary José Antonio Meade and had a meeting planned with President Enrique Peña Nieto later in the day.

Kerry struck a positive note on U.S. relations with Mexico. One of the goals for this visit was to increase educational ties between the countries. About 14,000 Mexican students study in the United States each year, but the number of Americans in Mexico has fallen to about 4,000, because of high levels of crime and drug violence in recent years.

President Obama has set a goal of 100,000 American students studying in Latin America, and the same number of Latin American students in the United States, by 2020.

During his visit, Kerry also met with university officials from the United States and Mexico to talk about furthering exchanges.