Abdel Fattah al-Sisi's remarks come two days after an Arab summit in Egypt that decided the Saudi-led air strikes against the Huthi rebels should continue until they surrender.
"The stability of Yemen and the safety of its people hangs from your necks," Sisi said in a televised speech to military and police officers.
"Take the decision: back off for your country's sake," Sisi said, addressing the rebel leadership without mentioning their names.
"It was not possible for us to abandon the security of the Gulf, and not send a message that we need to respect each other's interests," he added.
Signup to our newsletter and follow us on Facebook and Twitter!
Egypt had said it is taking part in the campaign with its air force and navy, and has pledged to commit ground troops if they are needed.
His comments came as the UN rights chief said Yemen was on the brink of "total collapse" and aid groups warned of a humanitarian crisis unfolding with air and sea blockades.
Sisi also spoke about the decision taken at the weekend Arab summit to create a joint Arab military force, saying its formation could be a "deterrent" in itself.
The president said each country that participates in the force could dedicate a unit from its military or navy that would be deployed for missions.
Talks on organising the force are scheduled to start within a month.