Representatives of the United States, Britain and Canada marked the 200th anniversary of the start of the War of 1812 during a ceremony Monday at Baltimore’s Fort McHenry, with the former enemies mixing pledges of comity with sly digs.

President Obama, addressing the commemoration in a recorded video message, called the anniversary an important one for all three nations. “In many ways, the War of 1812 helped define our young nation,” Obama added.

On June 18, 1812, President James Madison signed a declaration of war against Britain, after a bitterly divided Congress approved war in the closest such vote in American history. Soon after the declaration, the United States launched a series of unsuccessful invasions of Canada, which then consisted of a group of British colonies.

The ceremony, entitled “From Enemies to Allies: 200 Years of Peace,” highlighted subsequent relations between the three nations, including during World War I, World War II and the war in Afghanistan, where troops from the United States, Canada and Britain fought together.

Monday’s event, launched with a booming ceremonial cannon shot from the water battery at Fort McHenry, formally begins a three-year bicentennial commemoration for the war. It was held in a light rain along the water battery beneath the ramparts of Fort McHenry before hundreds of umbrella-toting spectators who listened to music from military bands and speeches from dignitaries.

“I must admit, when I visited the White House earlier this year, I was a bit embarrassed that my ancestors had managed to burn the place down 200 years ago,” British Prime Minister David Cameron said in his own recorded video address to the crowd.

But, Cameron added, “You can thank the British for your National Anthem,” a reference to the writing of the “Star-Spangled Banner” by Francis Scott Key during the unsuccessful British bombardment of Fort McHenry in September 1814.

Addressing the crowd, Navy Secretary Ray Mabus noted that Adm. Sir Mark Stanhope, Britain’s First Sea Lord, “ruefully points out whenever he is in the Secretary of Navy’s office, he is surrounded by paintings of burning British ships.”

Mabus added, “And he is.”

Monday’s ceremony was part of the week-long “Star-Spangled Sailabration” that has drawn hundreds of thousands of visitors to Baltimore and ends Tuesday with the departure of dozens of tallships and warships from the navies of a dozen nations.

The ceremony concluded with a joint performance by the U.S. Navy Band and Her Majesty’s Royal Marines Band of Great Britain playing John Philip Sousa’s “Hands Across the Sea.”