LONDON—The British air force killed two U.K. nationals who had joined Islamic State in a drone strike in Syria, Prime Minister David Cameron said Monday, marking the U.K.’s first acknowledged military action against militants in the country.

Mr. Cameron said the Royal Air Force killed Reyaad Khan on Aug. 21 as he was traveling in a vehicle near the city of the city of Raqqa. The prime minister said two Islamic State associates also were killed in the attack, including another British national, Ruhul Amin.

Mr....