The news agency’s account was suspended and it has advised all tweets should be ignored until further notice.
The false message said: “Breaking: Two Explosions in the White House and Barack Obama is injured.”
US markets were spooked by the tweet; the Dow Jones Industrial Average dropped 150 points as it was retweeted.
White House spokesman Jay Carney told reporters soon after the tweet was published that President Obama was fine, and financial markets quickly recovered the lost ground.
AP said later: “The @AP twitter account has been hacked. The tweet about an attack at the White House is false.”
The agency said the attack came after repeated attempts by hackers to steal the passwords of AP journalists, adding that it was working to correct the issue.
Twitter has not yet commented.
The tweet hack was the latest in a string of attacks on US media outlets.
Two CBS news programmes’ twitter accounts were suspended after fake messages appearing on the @60Minutes account criticised US support for “terrorist” rebels in Syria.
A group calling itself the Syrian Electronic Army claimed responsibility for hijacking the accounts.