A soured love affair may have led an ex-convict to gun down four men in the town that inspired the idyllic community of Mayberry on the 1960s TV series "The Andy Griffith Show," police said Monday.

Marcos Chavez Gonzalez, 29, was charged with four counts of murder in the slayings late Sunday outside a television store in Mount Airy, about 100 miles north of Charlotte.

The four were shot with a high-powered assault rifle outside Wood's TV, in the shadow of a water tower that says "Welcome to Mount Airy" and has a picture of Griffith and Opie, his son on the show.

Police do not believe the shootings were random. Mount Airy Police Chief Dale Watson said officers are investigating several leads, including whether it was a contract killing or repercussions from a love affair gone bad.

"This is Mayberry ... Andy Griffith's house is in spitting distance here," said Michael Wood, one of the owners of Wood's TV.

The town, population 8,700, has built a tourist trade on nostalgia for the show that continues to thrive in syndication.

Watson identified the victims — all residents of the town — as Victor Alfonso Martinez-Jimenez, 22; Javier Manuel Martinez, 21; Juan Manuel Martinez, 26; and Marcos Oviedo Aguliar, 21.

Michelle Oviedo, 21, said her boyfriend and brother were among the dead and the alleged shooter is her mother's boyfriend. She said she was sitting on her porch not far from Wood's TV when she heard the gunshots.

"When I got there, Javier and my brother were already gone," she said. "They were on top of each other."

Jose Armando Hernandez, 46, said through a translator that three of the victims were his nephews. He said his family is "destroyed" over the deaths, which he said stemmed from a problem with a woman.

Gonzalez was arrested without incident at a motel about 50 miles northeast of the town, Henry County, Va., Sheriff Lane Perry said. He was unarmed when he surrendered just before 4 a.m. to officers who had surrounded the motel.

He was extradited from Virginia and was being held in the Surry County jail. Jail workers said it was not clear whether he had an attorney.

Watson said 16 shots were fired but the assault rifle had not been found.

"It was quite a crime scene," he said.

State prison records show Gonzalez was released more than two years ago after serving more than two years on a 2002 conviction for kidnapping a minor and a probation violation.

State records show the felony kidnapping charge required Gonzalez to register as a sex offender. North Carolina's post-release supervision of Gonzalez ended in June 2006 when he returned to prison after failing to stay in contact with a probation officer, Correction Department spokesman Keith Acree said.

Nursing supervisor Sue Coe at Northern Hospital of Surry County confirmed that two people died at the store around 2:30 p.m. Sunday. She said two who were wounded died at the hospital, just across the street from the store.

By Monday, someone had set up a makeshift memorial with flowers. Mourners gathered there and some women lay on the ground crying. Someone christened the memorial with a bottle of Corona beer, which sat half empty next to brightly colored candles with photos of saints on them.

Gary Chilton, an owner of Chilton Insurance Group, which shares the building with Wood's TV, said the crime is an anomaly. Andy Griffith doesn't live there any more, but the town is still quiet.

"I'm not sure it's totally sunk in because it's so unusual. On any given Sunday there is nothing here in this parking lot. There's nothing here at all," he said. "My biggest question is why in this parking lot at all. Why Wood's TV parking lot?"