Veteran FBI agent Gerald Rogero was found guilty Friday of second-degree assault after he was captured on cellphone video striking a 15-year-old boy during a domestic dispute in Chevy Chase, Md. (Montgomery County State's Attorney's Office)

An FBI agent convicted last year of shoving a Maryland teenager — in an off-duty confrontation captured on cellphone video and viewed across the nation — had his guilty finding dismissed Wednesday by a judge who called the incident an unfortunate mistake in an otherwise stellar career.

The decision by Montgomery County Circuit Judge Steven Salant clears the way for Gerald Rogero, a unit chief in the FBI’s counterterrorism division, to continue his duties. Rogero has three daughters — two in college, one in high school — whom he has raised as a single father after the sudden death of his wife in 2008.

“Would it be in the best interest of the defendant — as a result of this isolated and unfortunate mistake of judgment — to deprive him of his employment, of his livelihood?” Salant asked from the bench, speaking to a courtroom packed with FBI agents supporting their colleague as well as friends and family supporting the teenager. “To impact upon his children? To impact upon the service that he can bring to the community? I think not.”

The case against Rogero received considerable attention because of the cellphone video that showed tensions escalating between Rogero and a group of people outside an apartment building along Wisconsin Avenue in Chevy Chase on a night in 2014.

At one point, a 15-year-old boy approached the agent, got within 18 inches of his face and, according to Rogero, threatened him. Rogero, 46, quickly struck him in the chest with the heel of his left hand, sending the teenager tumbling backward onto the pavement, the video showed.

Salant could have given Rogero jail time. Instead, he put him on two years’ probation, ordered him to take an anger-management course and imposed “probation before judgment,” which means that if Rogero abides by the terms of his probation, the case will go away completely.

Rogero has no criminal record. Salant noted that it is common for such defendants to receive “probation before judgment” for second-degree assault, a misdemeanor.

Rogero showed little emotion upon hearing the sentence. When Salant asked him if accepted the conditions, Rogero said, “I accept, your honor.”

That reaction was far different from Oct. 30, when a county jury returned its verdict after about five hours of deliberations. Rogero fainted and was taken by ambulance from the courthouse.

Through his attorney, Rogero declined to comment Wednesday after the hearing.

“Mr. Rogero looks forward to continuing to protect the citizens of America in his role in the counterterrorism unit and raising his three daughters,” said his attorney, Marlon Griffith.

Salant’s finding disappointed the teenager and his mother, who was with him when he was shoved.

“I think he deserves a little bit of jail time,” Alexandro Farooq, who is now 16, said after court as he stood beside his mother.

His mother, Jasmine Farooq, called the sentencing unfair but said she was pleased with one of its conditions: “I’m glad he will be taking those classes.”

On Dec. 15, 2014, Alexandro Farooq filed three criminal charges against Rogero, including first-degree assault, which is punishable by up to 25 years in prison. In an affidavit filed with the court, Farooq began by introducing a series of events that ultimately were not disputed.

The night of Dec. 5, 2014, a man named Edward Moawad arrived at the apartment building with a 1-year-old girl, whom he was taking to her mother as part of a custody arrangement.

Rogero was also there — in civilian clothes — because he and his girlfriend had been visiting the girl’s mother.

In the apartment lobby, Rogero questioned Moawad about why he was late for the exchange and soon was speaking with others who were with Moawad as the group made its way to a sidewalk outside.

At one point, Alexandro Farooq got close to Rogero’s face, prompting the agent to strike him with the heel of his open left hand, which sent the teen falling backward. Rogero then moved to arrest him.

“If I have to shoot you, I will,” he said. “Don’t make me shoot you.”

The two tussled, and Rogero drew his weapon and pointed it at the teenager. The situation eventually calmed down as county police officers arrived.

In Alexandro Farooq’s affidavit, he claimed that Rogero punched him with the palm of his hand, sending him flailing, and then dragged him “to a confined darker place without cameras.” Farooq also alleged that Rogero pushed his weapon so close to him that he felt “a cold sensation of a gun” on his temple, according to court records.

In October, county prosecutors brought Rogero to trial on charges of first-degree assault, use of a firearm in a violent crime and second-degree assault.

The first two counts related to Rogero pointing his gun at the teenager.

The cellphone video, which was played in court, clearly showed the agent shoving the teenager and him drawing his gun and pointing it at the teenager. It did not appear to show Rogero dragging Farooq to a dark area or placing his gun against the boy’s head.

The jury acquitted Rogero of first-degree assault and the gun charge, decisions that suggest jurors concluded that Rogero had acted illegally only as it related to the shove.

In court Wednesday, Rogero said that when Alexandro Farooq got close to him, the teenager threatened him. “I reacted instinctively to push Alex away,” he said.

Rogero also apologized to the teenager, his FBI colleagues and his family. “If I had the opportunity to do this over again, I would not have handled it the same way,” he said.

Three FBI colleagues also spoke in court, describing a committed, caring colleague with outstanding performance reviews.

Salant said he agreed with one of their assessments that Rogero had “an otherwise pristine background.”

Salant said that although Rogero was off duty, “he comes from a background where authority means something. And he was choosing to exercise that authority when he should have walked away.”

But on balance, the judge said, he didn’t want a guilty finding to impede Rogero’s career and added that the sentence was in the best interest of both Rogero and the public.