In 1774 Baldwin enlisted in a regiment, and commanded the Woburn militia at the Battle of Lexington and Concord as a major. At the beginning of the war he enlisted in the 26th Continental Regiment commanded by Colonel Samuel Gerrish. Here he rapidly advanced to be lieutenant-colonel, and on Colonel Gerrish's retirement in August 1775, he was placed in command of the regiment, and was soon commissioned colonel.