MADRID (Reuters) - U.S. President Barack Obama said on Sunday that the U.S. government has to improve its cyber security practices for the modern age of smart phones and other technology, saying that hackers had targeted the White House.

"I am concerned about it, I don't think we have it perfect. We have to do better, we have to learn from mistakes," Obama told a news conference in Madrid. "We know that we have had hackers in the White House," he added.

Concerns have been raised about the security of government information after the head of the FBI said presidential nominee Hillary Clinton's email servers may have been accessed by foreign actors when she was Secretary of State.

(Reporting by Ayesha Rascoe; Writing by Angus Berwick; Editing by Maria Vega Paul)