At least two police officers have been killed during an exchange of fire with armed fighters in western Afghanistan, an attack that also killed at least two fighters.
Ghul Agha Hashim, police chief of Herat province, said that at least seven civilians, including three women, were wounded in Tuesday's attack.
The men who carried out the attack then took refuge in a nearby house, and were killed after a 50-minute firefight with police, Hashim said.
Live Box 201491152731407786
Violence has been intensifying across Afghanistan as the presence of Taliban armed group spreads and law-and-order breaks down, presenting newly sworn-in President Ashraf Ghani with a continuing security challenge.
On Monday, a group of Taliban fighters attacked a court in the northern city of Kunduz in Afghanistan, killing at least seven people including some prosecutors.
The violence comes as Ghani undertakes a visit to China to meet President Xi Jinping and seeks help in rebuilding his country and improving security.
The trip is Ghani's first state visit abroad since taking office last month.
In an interview with Al Jazeera, Haroon Mir, a political analyst, said Afghanistan is seeking Chinese support to use its leverage over Pakistan.
Ghani wants China to convince the Pakistanis "that the stability of Afghanistan is in the interest of all countries in the region", he said.
Friendship and support
In opening remarks, Xi assured Ghani of China's friendship and support, saying he is willing to work towards "a new era of cooperation in China-Afghanistan relations and take development to a new depth and breadth".
So far, China's commitment to Afghan reconstruction since the fall of the Taliban regime in 2001 has been about $250m and its security support has been mostly limited to counter-narcotics training.
Live Box 201239113414952721
Afghanistan hopes Chinese investment will help make mining a cornerstone of its economy, with an estimated $3tn worth of natural resources, little of which have been exploited because of warfare and a lack of infrastructure.
Ghani told Xi that Afghanistan's development goals are closely aligned with China's promotion of regional cross-border economic development.
Ghani pressed China to open the Wakhan Pass connecting the two countries, a long-held request from Kabul which hopes to see an influx of Chinese development.
China has resisted, fearing unrest will spill over into Xinjiang, where armed men among the native Uighur population have launched a series of attacks in recent months.
China, which maintained contacts with the former Taliban government in the 1990s, is also willing to play a constructive role in promoting reconciliation between all parties in Afghanistan, according to its Foreign Ministry.
China's importance to Afghanistan is expected to expand further after US and allied combat troops leave by the end of the year, illustrating Kabul's desire to end its dependency on the West.
Source: Al Jazeera and agencies