Homeland Security Secretary Jeh Johnson refused to end a secret U.S. policy that prohibited immigration officials from reviewing public social media posts of foreign citizens applying for U.S. visas, a former senior department official told ABC News.

In early 2014, immigration officials asked Johnson to change policies to allow them to review applicants' online social media messages. But Johnson decided to keep the prohibition in place, fearing a civil liberties backlash and "bad public relations," said John Cohen, a former acting undersecretary at the Department of Homeland Security for intelligence and analysis.

"During that time period immigration officials were not allowed to use or review social media as part of the screening process," Cohen told ABC News.

Cohen's claim was confirmed by a current and former senior counterterrorism official, who said that officials felt it would be an invasion of applicants' privacy.

The revelations come after American law enforcement officials announced that they recently discovered that Tashfeen Malik, who with her husband carried out the terrorist attacks in San Bernardino, Calif., had talked openly on social media about her views on violent jihad, reported The New York Times.

Malik had passed three background checks by American immigration officials before moving to the U.S. from Pakistan in July 2014, but because immigration officials don't routinely review social media as part of the background checks, Malik's radical posts went unnoticed. Malik, who is believed to have radicalized her husband, went on to pledge allegiance to the Islamic State group on Facebook during the Dec. 2 massacre, which left 14 people dead and 22 injured, according to the New York Post.

Cohen told ABC News that top officials with the DHS's Office of Civil Liberties and the Office of Privacy opposed the monitoring of applicants' social media and feared "that it would be viewed negatively if it was disclosed publicly and there were concerns that it would be embarrassing."

Cohen continued: "Immigration, security, law enforcement officials recognized at the time that it was important to more extensively review public social media postings because they offered potential insights into whether somebody was an extremist or potentially connected to a terrorist organization or a supporter of the movement."

"There is no excuse for not using every resource at our disposal to fully vet individuals before they come to the United States," he added.

In the fall of 2014, months after Cohen left, the department began three pilot programs that included social media vetting, but the practice is still not a widespread and routine, DHS spokesperson Marsha Catron told ABC.

On Sunday, Sen. Charles Schumer, D-N.Y., demanded that immigration officials immediately begin a program to review social media sites of people admitted to the U.S. on visas, according to ABC.

"Had they checked out Tashfeen Malik ... maybe those people in San Bernardino would be alive," Schumer said.