A man wanted for attempting to kill his ex-girlfriend and two Stafford County law enforcement officers with pipe bombs was arrested in Montana on Thursday, authorities announced.

Laurence Alan Stewart II, 25, launched pipe bombs out of his vehicle -- several of which exploded -- while he was pursued by Montana Highway Patrol before authorities managed to disable his car, according to the Stafford County Sheriff's Office. Stewart then tried to escape on foot while armed with a handgun before he was taken into custody.

On Wednesday, authorities in Virginia charged Stewart, who has no fixed address, with two counts of capital attempted murder of a law enforcement officer, two counts of manufacture or possession of a weapon of terror and multiple other charges.

Three homes, one in Fredericksburg and two in Stafford County, were bombed over a period of about two hours early Tuesday morning.

In each case, a pipe bomb was placed or thrown at the homes -- one of which blew a hole in the roof of a Fredericksburg house -- but no one was injured in the explosions.

An investigation involving multiple law enforcement agencies, from the Stafford County Sheriff's Office to the Bureau of Alcohol, Tobacco, Firearms and Explosives, clearly indicated that the ex-girlfriend and two law enforcement officers were targets of the bombings due to an earlier investigation in which Stewart was charged, Stafford County sheriffs said Wednesday.

As the search for Stewart ramped up Wednesday, the Virginia State Police for the first time issued a "blue alert," used when a law enforcement officer has been killed or attacked and the suspect is still at large, according to spokeswoman Corinne Geller.

It's unclear whether Stewart will be extradited back to Virginia, but Stafford County Sheriff Charles E. Jett said authorities are determined to put him away.

"Whatever it will take to remove this person from society for the rest of his life is what this team here is committed to," Jett told reporters Thursday.

Stewart was also wanted for indecent exposure, obscene sexual display and violation of a protective order.