MEXICO CITY — For Mexico, the United States has been a difficult neighbor, sometimes violent, almost always arrogant, almost never respectful, rarely cooperative. Mexico, on the other hand, has been a good neighbor to the United States.

To each offense, we have responded first with a gesture of noble resignation and then by searching for a practical resolution through a conciliatory openness of mind. Our positive attitude has allowed our two nations to live for almost 200 years in a generally peaceful atmosphere, though there have been tragic episodes and periods of tension. It is a record of tranquillity that few countries sharing a border can claim.

But this state of relative accord is now being menaced by President-elect Donald J. Trump, who brandished a rabidly anti-Mexican agenda during his campaign and once elected showed a disposition to act on the basis of his slanders. At his news conference on Wednesday, he vowed again that Mexico would pay for the wall he wants to build. It may well be time for Mexico to change its practice of using appeasement to cushion the damage of historical grievances.

The first and most serious offense was of course the American invasion of Mexico in 1846 and the subsequent Mexican-American War, which resulted in Mexico losing more than half of its territory. It was so traumatic an event that it became the theme of our national anthem.