SAN FRANCISCO — Apple has hired Google’s chief of search and artificial intelligence, John Giannandrea, a major coup in its bid to catch up to the artificial intelligence technology of its rivals.

Apple said on Tuesday that Mr. Giannandrea will run Apple’s “machine learning and A.I. strategy,” and become one of 16 executives who report directly to Apple’s chief executive, Timothy D. Cook.

The hire is a victory for Apple, which many Silicon Valley executives and analysts view as lagging its peers in artificial intelligence, an increasingly crucial technology for companies that enable computers to handle more complex tasks, like understanding voice commands or identifying people in images.

“Our technology must be infused with the values we all hold dear,” Mr. Cook said Tuesday morning in an email to staff members obtained by The New York Times. “John shares our commitment to privacy and our thoughtful approach as we make computers even smarter and more personal.”