According to officials, one gunman has been shot dead and another is being pursued.
Tunisians, Britons, Germans and Belgians and at least one Irish citizen are among the dead.
In March militants killed 22 people, mainly foreign tourists, in an attack on a museum in the capital Tunis.
Tunisian President Beji Caid Essebsi has gone to Sousse’s Sahloul hospital to visit the injured.
Security officials said one attacker, who had posed as a swimmer but was carrying a rifle under a parasol, was shot dead in an exchange of fire with police.
Local media reported that the second attacker had been arrested, but this has not been confirmed. A photo purporting to show the body of the first attacker is circulating on social media.
The Hotel Imperial Marhaba was named as one of the hotels close to the attack.
The Belgian foreign ministry is advising against all travel to Tunisia and the Belgian Jetairfly airline has announced it is cancelling all flights to Tunisia because of the attack.
A spokeswoman for the Thomson and First Choice tour operators said: “We are working closely with our teams in Tunisia and the relevant authorities to determine exactly what has happened and provide assistance to those affected.”
Tunisia has seen militant Islamists gain strength since the overthrow of long-serving ruler Zine al-Abidine Ben Ali in a popular uprising in 2011.
Democratic elections after Zine al-Abidine Ben Ali’s removal saw the moderate Islamist Ennahda party take power before the secularist Nidaa Tounes government won a parliamentary poll in October.
However, neither party has been able effectively to combat Islamist violence made worse by a raging conflict in neighboring Libya and by Tunisian fighters returning home after going to join Islamist campaigns in Iraq and Syria.
Image source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…