US Secret Service said the man, Michael Arega of Dallas, was officially charged with making felony threats, and was not armed with a weapons at the time of his arrest.
The Secret Service's protective intelligence division was notified at about 2:55 p.m. ET to be on the lookout for Arega, who the Montgomery County Maryland Police Department said was heading to Washington for the purpose of killing "all white police" at the White House, according to the statement. The Secret Service spotted him at approximately 4:05 p.m. ET.
He was "immediately detained by Secret Service Uniformed Division Officers and subsequently arrested without incident," according to the statement.
The man's ex-wife alerted police from her home in Texas, according to Montgomery County Police spokesman Capt. Paul Starks.
Starks said the man's ex-wife was concerned about her ex-husband's mental and emotional health and that he had stopped taking his prescribed medications. She called police when she had discovered "troubling messages" on his Facebook page.
Montgomery County Police sent officers to the hotel that the man had checked into on Facebook in Silver Spring, Maryland, but the man was gone by the time officers arrived.
Starks said the man's former wife did the right thing in contacting police.
More about: #White-House