WASHINGTON — The Secret Service has fired two officers from its uniformed division who were on duty when a California man jumped the White House fence last month and roamed the grounds for 17 minutes, an agency official confirmed on Thursday.

The officers, who were not identified, had been stationed near the Treasury Department and East Executive Avenue, close to where the man, Jonathan T. Tran, 26, of Milpitas, Calif., first entered the White House grounds shortly before midnight on March 10. President Trump was at home, in the executive residence, at the time.

Despite tripping security sensors as he scaled several fences, Mr. Tran was able to peer through windows of the East Wing and approach the White House’s south portico before he was stopped by Secret Service officers. He was carrying a backpack with two cans of pepper spray, a book by Mr. Trump and a letter to him, the authorities said.

In a statement, the Secret Service declined to comment on the terminations, which were first reported by CNN. But an agency official who was not authorized to publicly discuss personnel issues confirmed the firings, speaking on the condition of anonymity.