Somali insurgents fired mortars toward U.S. Congressman Donald Payne's plane during a visit to the Somali capital in Mogadishu.

The New Jersey Democrat was not injured, his spokeswoman Kerry McKenney told FOX News, and Payne was not even aware of the attack until his plane set down in Nairobi, Kenya.

"Well as a matter of fact we were informed, believe it or not, when we arrived in Nairobi that there was some shelling at the airport or near the airport," he told a cable news network. "We took off and were not aware of the shelling, which is not uncommon if something of that nature happens."

Al Shabab, Somalia's militant Islamist rebel group, claimed responsibility for the mortars fired at Payne, Reuters reported.

"We fired on the airport to target the so-called Democratic congressman sent by (U.S. President Barack) Obama," Sheikh Hussein Ali, an al Shabaab spokesman, told Reuters.

Al Shabab is designated as a terrorist group by the U.S. State Department and is connected to Al Qaeda.

Medina Hospital Administrator Ali Adde said 19 civilians, mostly women and children, were injured when the shells landed in residential areas. Nine were admitted to the hospital and nine had light injuries, Adde said.

"One mortar landed at the airport when Payne's plane was due to fly and five others after he left and no one was hurt," Abukar Hassan, a police officer at Mogadishu airport, told Reuters.

McKenney said Payne, who chairs the House of Representatives' Foreign Affairs subcommittee on Africa, felt it was important to go to Mogadishu and see first-hand what was happening there.

His trip comes a day after U.S. sea captain Richard Phillips was rescued from four Somali pirates off Africa's eastern coast.

"All we know is his plane was fired on and of course we feel it was in retaliation," McKenney told FOX News.

She said Payne was traveling with bodyguards but she has not been able to speak to him directly because his plane was in the air.

He arrived early Monday in what is believed to be the first visit by a senior U.S. politician to Mogadishu in years, Reuters reported.

Payne told reporters he met with Somalia's president and prime minister during his one-day visit to Mogadishu to discuss piracy, security and cooperation between Somalia and the United States.

Payne spoke with reporters at a news conference in the presidential palace in Mogadishu.

The Associated Press contributed to this report.