WASHINGTON—President Barack Obama on Thursday vetoed legislation authorizing $612 billion in military spending over the next year, intensifying a battle between the White House and Congress.

Underscoring the escalating tensions over the annual National Defense Authorization Act, Mr. Obama made a rare public show of his veto by rejecting the legislation in front of television cameras and reporters in the Oval Office.