A Senate panel on Thursday backed legislation that would offer protections to a broad variety of journalists who do not want to divulge their confidential sources of information.

The key point of debate over the bill, which was advanced by the Senate Judiciary Committee by a 13 to 5 vote, had been the definition of a journalist.

Although some members had pressed for a narrower definition, the version to be debated on the Senate floor will cover journalists who had an “employment relationship” for one year within the past 20 years, or three months within the past five years, and someone with a “substantial track record” of freelancing in the past five years.

Student journalists are covered under the media shield legislation, as are individuals “whom a federal judge has decided should be able to avail him or herself of the protections of the privilege, consistent with the interests of justice and the protection of lawful and legitimate newsgathering activities.”

Groups such as WikiLeaks, which are not considered news outlets under the bill, would not be protected, according to congressional staffers. They said agreement on the bill was a compromise between Sens. Charles E. Schumer (D-N.Y.), who had proposed a broader definition, and Dianne Feinstein (D-Calif.) and Richard J. Durbin (D-Ill.), who had proposed a narrower one.

“This legislation ensures that the tough investigative journalism that holds government accountable will be able to thrive,” Schumer said in a statement. “I’m hopeful that both parties can come together and pass it quickly on the Senate floor.”

In the spring, President Obama urged Congress to pass a media shield law, especially in light of criticism that the Justice Department had been too aggressive in pursuing leak investigations and was infringing on press freedom.

After several high-profile investigations of reporters and their confidential sources, Attorney General Eric H. Holder Jr. in July tightened the ability of prosecutors to subpoena journalists’ phone and other records.

Holder’s guidelines came after a backlash from the news media and press freedom organizations over a pair of leak investigations:

In an unusually broad move, Justice officials obtained records from more than 20 phone lines assigned to the Associated Press and its journalists as part of a year-long investigation into the disclosure of classified information about a failed al-Qaeda plot last year.

In a second leak investigation, Fox News reporter James Rosen was called a possible “co-conspirator” in a crime in order to obtain a search warrant for his records.

At the time, Holder said he also supported efforts by Congress to pass a media shield law. “While these reforms will make a meaningful difference, there are additional protections that only Congress can provide,” Holder said.

The legislation advanced by the Senate panel on Thursday, called the “Free Flow of Information Act,” does not provide an absolute privilege to journalists. The legislation sets up a legal process for approving subpoenas for reporters’ records or sources. And it would require a judge, not the attorney general, to approve the subpoenas.

The legislation includes exceptions. Journalists, for example, would not be protected in “classified leak cases when information would prevent or mitigate an act of terrorism or harm to national security.”

In a statement, the Reporters Committee for Freedom of the Press welcomed the legislation.

“It’s not a perfect bill, but it goes a long way toward ensuring that reporters will be protected from subpoenas for their confidential information and sources,” said Gregg Leslie, the group’s legal defense director. “It tries to be as inclusive of all types of reporters as possible, and is not nearly as limited in that area as previous attempts at a federal shield law have been.”