SAN DIEGO — An on-the-run California man was tackled as he began climbing over the railing of a bridge Thursday and police led his four young sons to safety, a day after his wife was found dead in the trunk of the family car.

After his car was boxed in by armored vehicles on a San Diego County freeway, Daniel Perez, 43, of Montebello was hit with a beanbag round as he apparently tried to climb over the edge of the 150-foot-high overpass.

It was a stunning climax to an intense search for Perez, his wife, Erica, 39, and their four sons, ages 6, 8, 9 and 11. They family had vanished last Friday from their home 15 miles east of downtown Los Angeles.

Relatives said the parents had a troubled, violent marriage and both also had criminal records.

On Wednesday, Erica Perez’s body was found in the trunk of the family’s Honda Accord about a half-mile from the family’s home, police confirmed Thursday. The cause of her death had not been determined, but her husband was considered a “person of interest” in her death, said Montebello police Capt. Luis Lopez.

After the weekend, authorities began a sweeping search for the family. The California Highway Patrol issued an Amber Alert on Thursday stating the children were “taken by their biological father.”

Montebello detectives also activated an anti-theft tracker in the family’s other car, which alerted authorities to its location in El Cajon and triggered a pursuit shortly after 8 a.m.

The black Toyota Camry stopped on a freeway ramp in Santee after a pursuit that lasted about 10 minutes and reached speeds of 85 mph, said CHP Officer Kevin Pearlstein.

A police negotiator spoke by phone with Perez, who released two boys. Police sensed a sudden change in demeanor and sent in armored vehicles from both directions to block the car, along with about 25 San Diego County sheriff’s deputies.

“Something definitely changed,” Pearlstein said. “We decided we had to take a proactive approach instead of letting it play out.”

With television helicopters circling above, Perez got out of the passenger door and walked backward to the bridge railing with one boy at his side. Perez held a phone to his ear while the other boy followed a few steps behind. Police shot him with a beanbag round, Perez threw an arm and a leg over the railing, and officers rushed in to take him into custody.

Erica Perez was convicted in March 2011 of misdemeanor corporal injury to a spouse and sentenced to 60 days in jail, authorities said. Her husband’s cousin said it was a stabbing.