KABUL, Afghanistan — More than 40 people were killed across Afghanistan on Tuesday on the eve of talks between Afghan politicians and Taliban leaders in Moscow, as the militant group pursued a familiar tactic of intensifying its attacks before high-profile meetings.

Thirteen Afghan soldiers were killed by Taliban fighters in Khost Province, and 23 people, including Afghan special operations forces, police officers, civilians and militia members, died in western Ghor Province. In northern Samangan, Taliban fighters nearly overran an Afghan military outpost, killing at least six Afghan police officers and soldiers, according to Afghan officials.

But on Monday, Afghan soldiers wrested control of the Deh Yak district in southeastern Ghazni Province from Taliban fighters after a concerted offensive. The group had controlled the town for two years.

The spurt of violence came as Afghan politicians, including one of the candidates vying to replace President Ashraf Ghani in elections in September, and members of the Taliban arrived in Moscow to celebrate 100 years of diplomatic relations with Russia. The ceremony serves as an excuse for informal peace talks between Afghan politicians and 14 Taliban negotiators.