President Obama will modify the way the government uses a vast database of American phone records so that officials must have judicial permission before examining the data, a senior administration official said. 

In a speech Friday morning, Obama will also order an eventual end to the way the government holds the records, the official said. The database shows which phone numbers are called from which others and when.

Obama will direct the Justice Department to figure out how to maintain the database without having the government directly control the data. Atty. Gen. Eric H. Holder Jr. and intelligence officials will have until March 28 to report back to Obama on how the records will be stored.

In his speech, Obama will argue that the spy practices of the National Security Agency, including the collection of vast amounts of metadata on telephone calls, are important tools in fighting terrorism, the official said, requesting anonymity to discuss the speech in advance of its delivery.

But Obama believes "that we can and should be able to preserve those capabilities while addressing the privacy and civil liberties concerns that are raised by the government holding this metadata," the official said.

PHOTOS: President Obama’s past

In so doing, Obama is partially following the advice of a review group he appointed. The panel recommended in December that the government stop serving as the holder of the data and also recommended that a judge sign off before NSA analysts look into the database. In 2012, officials say, the NSA accessed the database 288 times, examining a total of about 6,000 numbers out of the billions it has stored.

In the weeks since those recommendations landed on Obama's desk, his aides have been unable to quickly devise a way to store the data outside government hands. Telecommunications companies are reluctant to take on that responsibility themselves, and no other third party has emerged as a candidate to take over that responsibility right away.

Advisors to the president also couldn't come up with a logical way to pay for the records storage in the time frame the president had laid out. He wanted to weigh in on the proposals before the end of January.

Obama will consult with members of Congress about how to carry out the eventual order. In the meantime, law enforcement and counterterrorism officials will have to get a judicial finding before accessing the database, according to the official.

It was not immediately clear how that judicial requirement would be structured and whether it would change after the database has been moved out of government control. The review panel recommended that the special court overseeing intelligence collection be required to weigh in when U.S. officials are seeking such sensitive records.

Twitter: @cparsons

christi.parsons@latimes.com