The Montgomery County Board of Education, ending its most divisive contract negotiations in more than 15 years, overwhelmingly approved last night a new three-year contract for county teachers.

The contract will increase salaries by 5 percent the first year, 6 1/2 percent the second, and by an amount equal to the cost-of-living increase in the third year. It was ratified last week by a vote of the county's largest teachers union.

Wearied board members and union officials hailed the conclusion of the nearly year-long negotiations and said they welcomed the opportunity to move on to the business of educating children.

Board member Blair Ewing said, "I believe we have focused on it more than I would have wished." But he called the contract "a reasonable resolution of some very difficult issues. . . . And now that we have an agreement, it will help us to focus on what is truly important, and that is the quality of the education of the students." Ewing voted for the contract, along with four other board members.

Board member Marian Greenblatt opposed it, and Suzanne Peyser, who submitted a 2 1/2-page attack on parts of the new contract, was absent.

The agreement follows nearly a year of teacher unrest. At times, dissatisfaction appeared so widespread that relations between the board and the union were said by some observers to be the worst since 1968, when county teachers went on strike.

By the end of June, the month the old contract expired, more than 700 of the county's 6,000 teachers in 27 schools stayed away from classes for a day to show their displeasure with the board's various contract offers. The board, weary of disruptions to classes, threatened to take a number of unprecedented steps against the teachers' largest union, the Montgomery County Education Association.

Last night, both board members and union officials attempted to put the year of frustrations behind them and pledged to work together. Jane Stern, president of the 4,800-member MCEA, said the union, on balance, was pleased with the agreement.

"It is obviously not all that we wanted," said Walter W. Rogowski, the union's executive director, before last night's board vote. "But in an age of concessionary bargaining . . . we've come out quite well. There have been no rollbacks in this contract."

One of the most significant gains, Rogowski said, was a new requirement that all new teachers hired by the county either join the union or pay an annual "agency fee" of between $200 and $300 in lieu of union dues. It was this section of the contract, said Peyser in her letter, that was "most objectionable" and smacked of "forced unionism."

In addition, the board and the union temporarily skirted a fight on a controversial "master teacher" proposal, a plan vigorously opposed by the union that would pay some teachers more on the basis of merit. The two sides have agreed to study the issue jointly.