Hillary Rodham Clinton on Saturday won the backing of the nation’s biggest labor group, the National Education Association, an endorsement that was expected but that nonetheless gives her a boost as she heads toward the first nominating contests.

The nod represents the second major group of educators to back Mrs. Clinton, after the American Federation of Teachers endorsed her in July – an early move that her allies hoped would be the first of many dominoes in organized labor to fall her way. The N.E.A. has three million members, and while many labor officials said it was likeliest to go to Mrs. Clinton, people close to her campaign insisted it was not certain until late last week.

It’s Mrs. Clinton’s eighth union endorsement. But it comes as Senator Bernie Sanders of Vermont has become a favorite of many of the rank-and-file members in some unions, whose leaders are reluctant to try to thwart members of their own constituency who are supporting a candidate who is speaking so directly to many of their issues.

The N.E.A.’s political arm made a recommendation to endorse her on Thursday, but the union president, Lily Eskelsen García, said that some members still wanted to hear from Mrs. Clinton personally at the board meeting on Saturday.

Mrs. Clinton spoke to the group in the morning.

“What surprised me was her answers,” said Ms. García, calling Mrs. Clinton deeply informed on every issue that matters to them, including special education and historically black colleges.

Asked whether the group came under pressure to endorse Mrs. Clinton from her campaign as she faces headwinds in the nominating fight, Ms. García insisted the timing was set by the union. But people privy to the discussions said that Mrs. Clinton’s advisers had pressed for an endorsement after a three-month lag since the A.F.T. endorsement.

On Friday, officials with the International Association of Firefighters publicly pulled back a planned endorsement of Mrs. Clinton, saying their rank-and-file members were not supporting her.

“As president, I will fight to defend workers’ right to organize and unions’ right to bargain collectively, and I will ensure that teachers always have a voice and a seat at the table in making decisions that impact their work,” Mrs. Clinton said in a statement about the N.E.A. endorsement.

Mr. Sanders, in his own statement, pointed out that he is the choice of many members.

“I am proud to have the support of many hundreds of thousands of members of the National Education Association and trade unionists all across America,” he said. “We are going to win this nomination and the general election because of support from grassroots Americans. We are on track to do just that.”

Ms. García acknowledged that not all members of the union will support the endorsement, and said members will have to “vote their heart.” But she said Mrs. Clinton stood above Mr. Sanders and Martin O’Malley, the former governor of Maryland who is also running for president, in her commitment to their issues.

The three candidates were the only ones among two dozen politicians to respond to an endorsement questionnaire sent by the N.E.A.