Answer: As a Mexican declaration of war
Step-by-step explanation:
After Texas defeated Mexico in a war of independence and became an independent state, the Texans claimed their border with Mexico to be territory around the Rio Grande. Mexico did not recognize this as they did not recognize Texas as an international state.
When the U.S. annexed Texas, this boundary was still disputed and so President Polk sent General Taylor to ensure that the boundary was secure. In a deliberate provocation, Taylor crossed into the disputed territory and the Mexicans saw this as an invasion and attacked the U.S. forces under Taylor.
This was interpreted by the U.S. as a declaration of war from Mexico and Congress responded by declaring war the next month.