A 21-year-old man described as having a hatred for Washington and President Obama was arrested Wednesday in connection with rifle shots fired near the White House last week as authorities sought to link the gunfire to bullet damage discovered at the executive mansion, officials said.

The suspect, Oscar Ramiro ­Ortega-Hernandez, who had been the focus of an intense law enforcement search since the gunfire Friday evening, was arrested at a western Pennsylvania hotel shortly after 12:30 p.m., the Secret Service said. U.S. Park Police had obtained an arrest warrant charging him with felony possession of a dangerous weapon.

On Tuesday, four days after the gunfire, officials discovered at least one bullet hole in a window on the south side of the White House, the Secret Service said. The window is about 750 yards from where the shots were fired, at Constitution Avenue and 16th Street NW, between the Ellipse and the Washington Monument.

Authorities declined to say whether they found other bullet damage at the mansion.

Ortega-Hernandez, whose permanent place of residence is unclear, has a record of arrests on minor counts in Texas, Utah and Idaho, authorities said. They said they have not linked him to any radical organizations.

In trying to determine why he recently traveled to the nation’s capital from the western part of the country, investigators searched the Occupy D.C. campground near the White House but have found no connection between him and the Occupy protesters, according to three law enforcement officials familiar with the case.

One of the officials, speaking on the condition of anonymity because the investigation is continuing, said the motive for the gunfire might have been simple anger: Ortega-Hernandez “hates the president, he hates Washington, he hates society,” the official said.

Ortega-Hernandez fired shots with an AK-47-style assault rifle about 9:30 p.m. Friday — his 21st birthday — while in a car at 16th Street and Constitution Avenue, police said.

Minutes later, Ortega-Hernandez abandoned the car a short distance away, in the 2300 block of Constitution Avenue, and ran away, police said. They said they found the rifle and an undisclosed number of spent shell casings in the car.

Obama was not in the White House at the time of the incident and is now in Australia.

In searching for Ortega-Hernandez, authorities said, they had been in contact with his family. Acting on information provided by the Secret Service’s Pittsburgh field office, Pennsylvania State Police arrested him at a hotel in Indiana, Pa., about 70 miles east of Pittsburgh.

For several days after the shooting, police said they had not found bullet-related damage to structures in the area. On Tuesday morning, however, authorities discovered at least one bullet hole in a window on the side of the White House facing the Ellipse and the Washington Monument, according to the Secret Service.

The bullet had pierced the “historic exterior glass” of the window but was stopped by ballistic glass installed behind the normal glass. “One additional round has been found on the exterior of the White House,” the Secret Service said in a statement.

The official familiar with the investigation said FBI ballistics examiners will seek to determine whether the bullets came from the assault rifle found in the car that Ortega-Hernandez abandoned.

The Secret Service said the damage “has not been conclusively connected to Friday’s incident, and an assessment of the exterior of the White House is ongoing.”

Gunfire near the White House has been extremely rare over the past two decades.

In the most brazen incident in modern memory, a 26-year-old Colorado man, Francisco Martin Duran, pulled an assault rifle from under his trench coat on an October Saturday in 1994 and opened fire on the White House from Pennsylvania Avenue NW.

As terrified sightseers scrambled for cover, Duran moved along the sidewalk, firing at least 29 shots at the mansion while a tourist videotaped the assault. When Duran stopped to reload, he was tackled and subdued by two witnesses.

A judge sentenced him to 40 years in prison after he was convicted of attempting to murder President Bill Clinton, who was in the White House at the time of the incident.

The next May, Leland William Modjeski, 37, of Falls Church scaled the White House fence with an unloaded handgun and wrestled with a uniformed Secret Service officer. Both were wounded, neither seriously, by the officer’s weapon.

Staff writer Del Quentin Wilber contributed to this report.

More from PostLocal:

Bullets found on White House grounds

Nov. 13: Police obtain warrant for White House shooting suspect

Nov. 13: Police identify person of interest in White House shooting

Nov. 11: Gunshots reported near White House