PORTLAND — Two Portland-area media firms produced the public service announcement that led to Wednesday’s capture in California of Boston fugitive James “Whitey” Bulger, who was wanted for 19 murders and had been on the run for 16 years.

The FBI hired two firms, Northeast Media Associates, based in South Portland, and Black Fly Media of Portland to produce a 30-second television announcement.

The spot includes photographs of Bulger, 81, and his girlfriend Catherine Greig, 60, who was wanted for harboring him. The message urged the public to contact authorities with information on their whereabouts.

“I was shocked and surprised that it happened, and that it happened so quickly,” said Charlie Berg, president of Black Fly Media, of Bulger’s arrest. Black Fly, which specializes in creating high-definition videos, edited and distributed the announcement.

“Sixteen years they have been looking for this guy. It’s pretty cool that we played some part,” he said.

Angie Helton, president and principal of Northeast Media Associates, said she heard news of Bulger’s arrest first thing this morning.

“I woke up this morning and my husband was screaming, ‘Angie, look at this headline,'” said Helton, whose public relations and video production firm helped edit the script and produce the announcement. “I said, ‘You’ve got to be kidding me.’ “

Four FBI agents came to Maine to work with Helton and Berg on the announcement. They worked in Berg’s home production studio in Saco. Helton helped edit the script and both firms produced it.

The announcements began airing on television stations Tuesday in Boston, Chicago, San Francisco, San Diego, Tucson, Phoenix, Albuquerque, Milwaukee, Mobile- Pensacola, Tampa, New Orleans, Biloxi, Miami and Fort Myers.

On Wednesday, the Boston office of the Federal Bureau of Investigation announced agents arrested Bulger and Greig near Los Angeles without incident.