On March 30, 1841, José Matías Quintana died in Mexico City. That same month the state of Yucatán published its constitution after having declared its independence from Mexico the year before. After losing Texas in 1836 and capitulating to the French in 1839, Mexico could not risk losing another state to secession. In November Quintana Roo was sent to Mérida to negotiate with Yucatán to remain in Mexico. Quintana Roo successfully negotiated the return of Yucatán before the new year. On his return voyage he was briefly a prisoner of a Texas warship but was quickly released. Although the Mexican government did not agree to the terms Quintana Roo had negotiated, an agreement was reached by 1843.