A Brookfield man was found with a loaded handgun in his car after he failed a field sobriety test during a traffic stop early Friday in west suburban Riverside.

Xavier J. Mireles, 26, was charged with aggravated unlawful use of a weapon, unlawful possession of ammunition and two counts of drunken driving, according to Riverside police. He was also cited for several traffic offenses.

At 2:58 a.m., a patrol officer saw Mireles driving a 2008 Chevrolet Impala “erratically” and weaving through traffic near the intersection of Woodside Road and Park Place, where he nearly struck the median, police said.

After the officer tried to pull his car over for blocks, Mireles parked somewhere on Washington Avenue in Brookfield, police said.

“This was not a pursuit — the driver was simply so intoxicated that he did not observe the officer until he came to a parked position,” according to Riverside police Chief Tom Weitzel.

When the officer approached Mireles he smelled alcohol on his breath and noticed his speech was slurred and his eyes were bloodshot, police said. Mireles then failed every field sobriety test he was given and his blood alcohol content was clocked at .10, which is over the legal limit.

The officer later found a loaded Smith and Wesson M&P 9mm pistol in the driver’s seat prior to Mireles’ car being towed, police said. The officer also found open Modelo beer bottles near the front seat.

While he was in custody, it was learned that Mireles was likely heading to his ex-girlfriend’s Brookfield home, police said.

Mireles had some type of dispute with the ex-girlfriend earlier in the week that had been reported to Brookfield police. Following his arrest on Friday, he was served with an outstanding protective order for the female, police said.