The federal agency that brings labor-related complaints on behalf of workers is wading into uncharted legal territory, ruling for the first time in a case about whether a company can legally fire employees for posting critical Facebook comments about a co-worker’s job performance.

The September decision found that five workers at Hispanics United of Buffalo, a New York social services nonprofit, were fired illegally for criticizing a colleague on Facebook, and should be reinstated because their actions were protected under federal labor law. The case is part of a boom of complaints brought on behalf of workers challenging their employers’ right to fire them for Tweets, Facebook posts and YouTube videos that didn’t sit well with their bosses. But this ruling marked the first time an administrative law judge with the National Labor Relations Board weighed in on the matter.

The judge based his ruling on Section 7 of the National Labor Relations Act, which says as that long as employees are communicating with each other to improve working conditions and wages, their actions — even if they criticize the company — are protected. The grounds are noteworthy because they are separate from the First Amendment rights more commonly invoked by disgruntled workers in social media cases (those cases don’t go before the NLRB, which only handles Section 7 matters).

The board has seen cases involving social media skyrocket from zero to more than 100 in the past five years, said NLRB acting general counsel Lafe Solomon.

In August, the board issued its first written guidelines for employers, analyzing 14 social media cases that have been brought in the last year, including that of a medical dispatcher in Indiana who was fired after posting on her senator’s Facebook wall that her employer won contracts with fire departments because it paid its workers lower-than-average wages.

The U.S. Chamber of Commerce came out with its own comprehensive report in August on how to apply labor law to workplace social media policies.

“Ten to 15 years ago, everyone was coming out with an Internet policy,” said Brad Shear of the Law Office of Bradley S. Shear in Bethesda, who last year helped draft the state of Maryland’s election laws regulating candidates’ use of social media pages. “Now it’s social media policies. That’s something every company should look at.”

He said the trick is to come up with rules that are broad enough to accommodate changing technology, but specific enough to provide real guidance on what not to do.

“It’s best to be as simple as possible,” said Shear, who recently advised a client, who he declined to name, on how to legally fire a worker for inappropriate social media posts. “The rules that apply in the real world apply in the virtual world.”