A toddler has squeezed through the fence surrounding the White House, setting off a security alert.

The boy squeezed through the fence in front of the residence about 8.10pm on Thursday (local time), a White House statement said.

The incident caused "a brief commotion among Secret Service agents, before the tot was returned to his parents", the statement said.

"We were going to wait until he learned to talk to question him, but in lieu of that he got a time-out and was sent on (his) way with (his) parents," said Edwin Donovan, spokesman for the US Secret Service.