The unmanned aircraft that made history when it achieved two tailhook landings aboard a moving aircraft carrier Wednesday suffered a computer glitch on its third attempt and had to divert to shore, the Navy said Thursday.

Instead of spending the next six days on board the aircraft carrier George H.W. Bush, the prototype X-47B “waved off” the carrier landing and touched down at Wallops Island flight facility on the Eastern Shore of Virginia.

The disrupted attempt came on the heels of success. Twice on Wednesday, the aircraft made automated landings on the carrier flight deck, witnessed by top Navy leaders and dozens of journalists who were brought on board for the event.

Landing on a carrier is one of the most difficult tasks that fighter pilots perform. It involves adjusting for the movement of the ship at sea and complex wind patterns behind the moving ship. Program operators said it took years to develop the computer algorithms that enabled the drone to respond to all those variables.

After the two landings, Navy Secretary Ray Mabus and Adm. Jonathan Greenert, chief of naval operations, lauded the technological feat and the story it foretold of a future in which automated drones will be a regular complement to the Navy’s carrier air fleet – allowing for round-the-clock surveillance operations in addition to strike capability.

After the journalists departed the ship about 4 p.m. Wednesday, the prototype, which goes by the call sign Salty Dog 502, was launched by catapult for a third landing attempt.

It was about 4 miles out and was approaching the deck for a landing when there was a fault with one of three computers used for navigation on the X-47B, said Capt. Jaime Engdahl, the program’s manager.

The other two computers recognized the “anomaly,” and the drone responded the way it was programmed to, he said. It waved itself off and, as it climbed, alerted the mission operator, who directed the craft to fly to the nearest landing site on shore, on Wallops Island.

“We have a triple-redundant navigation system,” Engdahl said. “That’s what gives us the level of safety and the level of reliability to land on a ship. One of them had a software issue. The team looked at it and said the best thing to do is send the aircraft back to shore and recover it there.”

He said the team was still looking at the data to determine exactly what happened, but expected that a simple reboot – turning the drone off and then restarting it – would remedy the problem.

The drone was still at Wallops Island on Thursday afternoon. It will fly home to Patuxent River Naval Air Station in Maryland when weather permits, the Navy said.

The hope is that it can return to the carrier before Monday, when more tests are scheduled. If not, its prototype twin will conduct the tests, a Navy spokesman said.

Engdahl said that although the third test did not go as planned, he was pleased with the outcome.

“The aircraft and the team – everybody followed the procedures,” he said. “The aircraft followed perfectly. It was actually very successful in doing what it had to do.”