US President Barack Obama has delivered the eulogy for the pastor that died in the mass shooting in South Carolina.

Reverend Clementa Pinckney was a pastor at the Charleston’s Emanuel African Methodist Episcopal Church where the shooting took place.

He was among the nine people who died when a gunman opened fire during Bible study.

During the eulogy, Mr Obama called the Confederate battle flag a symbol of oppression, adding that America had been blind for too long to the pain it causes.

Mr Obama also lead the congregation in singing 'Amazing Grace'.

Barack Obama sings 'Amazing Grace' at the funeral for Charleston victim

The eight other victims were named as Susie Jackson, 87; Reverend Daniel Simmons, 74; Ethel Lance, 70; Myra Thompson, 59; Cynthia Hurd, 54; DePayne Middleton-Doctor, 49; Sharonda Coleman Singleton, 45; and Tywanza Sanders, 26.

The first of the victims’ funerals took place yesterday, when Ethel Lance and Sharonda Coleman-Singleton were laid to rest.

The church is the oldest African Methodist Episcopal church in the southeastern US and was founded by slaves.

The president was accompanied by both First Lady Michelle Obama and Vice President Joe Biden.

All three knew Reverend Pinckney personally.

During his presidency, President Obama has spoken at six memorial services for victims of mass shootings, in Texas, Arizona, Colorado and Connecticut.

Speaking at the White House last week, he said: "I've had to make statements like this too many times. Communities like this have had to endure tragedies like this too many times."

The president repeated his calls for tougher gun laws, a controversial issue in the US where the constitution guarantees the right to own guns.

The mass shooting has sparked a dialogue across the southern states over the legacy of slavery and its symbols, centering on the Civil War-era battle flag of the Confederacy.

South Carolina Governor Nikki Haley and other Republicans have called for the Confederate flag to be removed from the State House grounds.

Some major retailers are removing merchandise with Confederate images from stores and websites.

The Department of Justice has opened a hate crime investigation into the shooting.

A 21-year-old white man, Dylann Roof, has been arrested in connection with the shooting. He faces nine murder charges and one gun charge.