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.
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…
Misleading allegations, rumours and outright lies about voting and fraud are flooding online spaces in…
At least 158 people have died in Spain's worst flooding disaster in generations. On October…
Google has been fined two undecillion (a two followed by 36 zeroes) roubles by a…
Embarking on a home remodel is an exciting journey, promising enhanced comfort, increased property value,…
The US presidential candidates continued to campaign across key swing states on October 20. Footage…