A security fence around the perimeter of the White House in March. (Saul Loeb/AFP/Getty Images)

A California man who breached the White House's secure perimeter and roamed free for nearly 17 minutes in March was sentenced Monday to two years probation and ordered to stay away from the White House, Mall and Trump hotels and properties worldwide.

Jonathan T. Tran, 27, of Milpitas, was sentenced by U.S. District Judge James E. Boasberg of Washington after pleading guilty to one, misdemeanor count of knowingly entering and remaining on restricted grounds in July.

Tran, an unemployed electrical engineer diagnosed this summer with paranoid schizophrenia and depression, was unarmed during the March 10 incident and told the U.S. Secret Service he was "a friend of the president" who wanted to warn him about "fake news." Tran was carrying a letter he wrote to President Trump that said he had information related to "Russian hackers."

Tran's incursion led to renewed criticism of the service and further restrictions on public access around the presidential residence. Tran was not caught for nearly 17 minutes after being detected shortly before midnight on a rainy Friday night crossing a five-foot outer fence near East Executive Avenue and the Treasury Department. His breach triggered multiple alarms and, at various points, Tran peered into a White House window and hid behind a pillar, according to surveillance video and officer accounts.

In a brief statement in court Monday, Tran said, "I severely regret what I did. Clearly it was wrong. I did not intent to encourage others … My mind was in another place.".

Boasberg said he agreed with prosecutors that Tran's was "not a victimless crime, in that it distracted government officials" and impeded them from other duties. "This is a serious crime, and it needs to be taken seriously. That said, I do believe probation is an appropriate sentence," Boasberg said.

U.S. prosecutors sought a six-month prison sentence, noting the Secret Service has reported an increase in actual and attempted fence jumping this year, in each case diverting a wide range of federal and local agencies from other emergencies.

Tran's obsession with Trump "appears to be too strong to be checked" without incarceration and "make him a continuing threat," Assistant U.S. attorney David J. Mudd wrote the court, adding that even after his arrest, Tran posted a social media message explaining that he went to the White House because he "wanted to speak to [Trump] in daylight to clear up this dossier fiasco."

Assistant Federal Defender Tony W. Miles opposed any incarceration as unjust because of Tran's mental illness, lack of criminal history, adding that he has responded well to treatment and complied with release terms pending sentencing.

"Mr. Tran's offense occurred not because he is a bad person, but only because he experienced an uncontrollable mental health episode," Miles said.

Boasberg ordered that Tran continue mental health treatment and cooperate in threat assessment by the Secret Service.

Tran was jailed three days after his arrest before being released to his family's home in Northern California pending his return to court, subject to court and electronic monitoring, mental evaluation and treatment if ­necessary.