LOS ANGELES (AP) — A man with a semiautomatic rifle opened fire at a church festival Saturday, wounding his ex-wife and two bystanders before festival attendees grabbed him and held him for police, authorities and a church official said.

Gunfire rang out on a grassy field where the festival was being set up at the St. John Baptist de la Salle Roman Catholic parish shortly before 11 a.m., said police Capt. Steven Ruiz.

"We believe this is an isolated incident, a domestic-violence dispute," he said.

The Rev. Robert Milbauer, the parish's pastor, said a woman injured in the attack was the gunman's ex-wife. The two have a child who attends the school and had been mired in an ongoing dispute, Ruiz said.

The gunman's identity was not immediately released.

He opened fire with a .22-caliber rifle a few minutes before the church's annual weekend festival was to begin. Milbauer said about 50 people, mainly church volunteers and their children, were setting up food and game booths and carnival-style rides when the gunfire erupted.

The man's 30-year-old ex-wife was one of the festival workers. She was hospitalized in stable condition, Ruiz said.

A 45-year-old man was shot in the chest and was in critical condition and another man, 47, was in stable condition with a leg wound, Ruiz said.