A cadre of Menlo-Atherton High School students used some high-tech savvy, a Mideast connection and a gift card to pull off a senior prank that kept most of their classmates away from school until third period Friday.

Right around 6:40 a.m., the home phones of about 1,700 Menlo-Atherton students received automatic “robo-calls” from a number that showed up on caller ID as 650-322-5311, the school’s office number.

“This is an important message regarding a serious electrical failure at Menlo-Atherton High School,” the robo-call said. “Due to the potential hazards this morning’s events may induce, school has been temporarily postponed until third period.” The message then repeats in Spanish.

The caller rang back five minutes later for those who didn’t pick up the phone the first time and left voicemails for those who still didn’t answer.

Students familiar with the prank, who divulged details to the Bay Area News Group on the condition of anonymity, said it worked perfectly and the school was “empty” during the first two periods.

Here’s how they did it: The students obtained the school directory and converted it to an Excel spreadsheet. They plugged the numbers into a Web site that makes robo-calls, using a friend in Israel to sign up for the service. That way, the computer IP address for the person responsible for the calls was traced back to the Middle East. The site allows users to enter any caller ID number for the calls, and the pranksters recorded the message using a fake robotic computer voice.

The students used a Visa gift card to pay the $150 to $200 fee for the calls, because the gift card is not traceable to a specific person as a regular debit or credit card is.

Menlo-Atherton officials sent out counter-calls telling students to come to school but the caller ID again showed the school’s office number.

Students said their classmates finally arrived in time for third period, about 9:35 a.m., and the pranksters had not been caught by the time school let out Friday.

Sequoia Union High School District spokeswoman Bettylu Smith said the incident is under investigation, but there was no breach of the school’s telecommunications or student information system.

“Preparation for finals is in full swing and, although a number of students arrived after the school day began (Friday) morning, school business continued as normal,” Smith said.