The three soldiers died and seven border guards were wounded as a barrage of rockets crashed into the Asir region, the ministry said in a statement carried by the official Saudi Press Agency.
The army returned fire.
In the neighbouring region of Jazan, a paramilitary fighter was killed and another wounded in shelling from the Yemeni side of the border, the interior ministry said.
The bombardment came during a day of relative calm in Yemen itself, where forces aligned with exiled President Abedrabbo Mansour Hadi are fighting Shiite Huthi rebels.
Also Read
They are supported by a Saudi-led Arab coalition which launched air strikes on the Huthis in March.
The border barrage came on the final day of what was supposed to be a ceasefire to allow in aid for Yemen's stricken civilians.
The humanitarian pause, declared by the coalition, began Monday but collapsed the next day.
Coalition air strikes resumed after the rebels, according to witnesses, shelled residential areas in the southern town of Taez.
According to the United Nations, the war has killed 3,984 people inside Yemen, nearly half of them civilians.