ANKARA, Turkey — Turkish fighter jets shot down a Syrian warplane on Sunday after it violated Turkish airspace, Turkey’s prime minister said, part of the longstanding hostilities between the two nations over the conflict in Syria.

“If you violate my airspace, our slap will be a hard one,” Prime Minister Recep Tayyip Erdogan said during a televised campaign speech in northwestern Turkey. Mr. Erdogan praised the Turkish military for its response, as did President Abdullah Gul, according to a report by NTV, a private television channel.

Two Syrian warplanes entered the airspace over southern Turkey on Sunday, but one turned back to Syria after the pilots were warned against entering by the Turkish Air Force, a statement posted on the military’s website said. When the other Syrian plane did not comply, it was shot down by a Turkish F-16 fighter jet, the statement said.

The flight of the two Syrian MIG-23 jets heading north from Syria was monitored for 80 nautical miles, and the pilots were warned four times before reaching 10 nautical miles of Turkish airspace, the statement said.