* Syrian Kurdish groups seize nearly all Hasaka
* Turkey shells Kurdish positions in Manbij
* Turkey-backed rebels expected to launch attack for Jarablus
* Commander of Jarablus military council assassinated
BEIRUT, Aug 23 (Reuters) - Kurdish forces were in near full control of Syria's city of Hasaka on Tuesday after battling pro-government militias, though some government officials remained holed up in buildings in the city centre, a Kurdish official and monitoring group said.
The battle over Hasaka marks the most violent confrontation between the Kurdish YPG militia and Damascus in more than five years of civil war, and victory would be a major boost for the Kurds despite Turkish efforts to curb their gains.
Ankara, which its fighting militants from its own Kurdish minority, has begun to step up efforts to curb the growth of Kurdish influence in Syria, where it backs Sunni Arab groups that are also hostile to the YPG.
On Tuesday Hasaka's remaining government officials were confined to a few buildings in the city centre while the rest of the city was under Kurdish control, Syrian Observatory for Human Rights Director Rami Abdulrahman said.
"Even if they (pro-government militias) keep a symbolic presence, it is a big defeat for the regime in Hasaka," said Abdulrahman.
The YPG, a critical part of the U.S.-backed campaign against Islamic State, controls swathes of northern Syria where Kurdish groups have established autonomy from Damascus since the start of the Syria war in 2011.
"The overwhelming majority of the city is under the control of the People's Protection Units (YPG) and the Asayish, apart from the security zone," said Naser Haj Mansour, the Kurdish official, adding that some fighting was still underway.
The Asayish is a YPG-affiliated security force.
He described the outcome as a "step forward" for the Kurdish groups that want a federal solution to the Syrian war to safeguard their autonomy. The Kurdish forces also seized five villages from pro-government militiamen, the Observatory said.
YPG-controlled areas of northern Syria include an uninterrupted 400 km (250 mile) stretch of the Syrian-Turkish border from the frontier with Iraq to the Euphrates river, and a pocket of territory in northwestern Syria called Afrin.
Turkey's military returned fire with artillery at targets across the border in northern Syria on Tuesday, after mortar shells and rockets from Syria hit two Turkish frontier towns, broadcaster NTV said citing the military.
NTV said Turkey's military fired 40 shells at four Islamic State targets in northern Syria, near where Turkish-backed Syrian rebels are preparing to battle Islamic State for control of the strategic town of Jarablus.
MILITARY LEADER ASSASSINATED
Kurdish influence spread further this month when a U.S.-backed alliance of militias including the YPG captured the city of Manbij from Islamic State, west of the Euphrates.
Turkey has said it expected Kurdish fighters to withdraw back to the east bank of the Euphrates.
Turkey is backing an expected operation by Syrian Arab rebel groups to seize the Islamic State-held Jarablus at the border, an assault that would prevent that town also falling to groups allied to the YPG. Jarablus is 40 km (25 miles) north of Manbij.
Turkey's military fired on Syrian Kurdish targets 20 times with artillery at Manbij on Monday, a Turkish official said. In addition, they targeted Islamic State targets in Jarablus. The official said the aim was to open a corridor for the rebels.
The Arab rebel groups due to take part in the Jarablus operation are themselves hostile to the YPG, having fought with it further west near Aleppo this year.
The U.S.-backed alliance including the YPG is known as the Syria Democratic Forces (SDF).
The leader of the newly declared "Jarablus military council", set with the aim of mounting its own campaign to seize Jarablus with SDF support, was assassinated on Monday, the Observatory said. Mansour, the Kurdish official, said two "agents of Turkey" had been detained over the killing.
(Writing by Tom Perry; Additional reporting by Daren Butler in Istanbul and Umit Ozdal in Karkamis, Turkey; Editing by Raissa Kasolowsky)
Our Standards: The Thomson Reuters Trust Principles.