A security lockdown at the White House triggered by a loud bang just as President Barack Obama was due to leave was caused by a food vendor cart catching fire on a nearby street, the Secret Service said on Saturday.

The security alert happened just moments before Obama and his family had been due to board a helicopter from the presidential mansion's South Lawn for Andrews Air Force Base.

Secret Service spokesman Brian Leary said the fire had now been contained and that a vehicle near the White House was being investigated after a bomb-sniffing dog detected something on it.

Obama and his family left the White House by motorcade instead of helicopter an hour later and boarded Air Force One at Andrews Air Force Base.

The Obamas are traveling to Selma, Alabama, to commemorate the 50th anniversary of a civil rights march.

Over the past few months, the White House has come under several lockdowns, mostly caused by intruders jumping the fence.