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.
The US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…