WINCHESTER, N.H., JUNE 30 -- In the wooded hills of southwestern New Hampshire, where home is often a trailer park or a struggling farm, old ways die hard and outsiders are not always welcome. No one in this small mill town, settled more than 250 years ago, knows that better than Dennis Littky.

Littky, 42, is principal of Thayer High School here. Since his arrival from New York nine years ago, life at the school has changed so much that Littky was the only issue in today's bitter special election for two town school board seats.

"This town is divided," said an angry Robert Secord, one of two incumbents on the ballot and a leader of the anti-Littky faction. "There's only one issue here: whether to keep Dr. Littky or not."

This afternoon, Thayer's parking lot was jammed with voters in what appeared to be a record turnout. "There's no way to call this election," Police Chief James Harrison said. "There are people here I've never seen before, and I've lived here all my life."

Littky nervously greeted friends in the school auditorium, the town's only polling place. "I'm waiting for 7 o'clock," he told one, "to see what happens to my life."

With his wire-rimmed glasses and long red beard turning to gray, his alien status is instantly apparent. But his supporters say he has succeeded where locals have failed in making Thayer more attractive -- and more useful -- for teen-agers who might otherwise drop out or merely bide their time before taking jobs at the local tannery or paper mill.

Terri Racine, a single mother whose baby arrived in her sophomore year, was president of this year's graduating class. Littky "helped push me through school when I had my baby," she said. "He told me I was too smart to drop out."

Racine will spend the summer working in the meat department of a local supermarket and is scheduled to start paralegal courses at Becker Junior College in Worcester, Mass., this fall.

Despite such stories, Littky's methods have engendered enemies, including many who disapprove of his informal style. "There's no way in hell you're going to teach kids on the buddy system," said School Board Chairman Allen Barton, a farmer who teaches engineering at a nearby community college.

In an interview at his vegetable farm on the edge of town, Barton said he does not believe state figures showing that the number of Thayer graduates who go on to college or trade-school enrollment has more than doubled during Littky's tenure. And he criticized Littky, who holds doctorates in education and psychology, for allowing students to call him "Doc."

"If he's going to be a good principal, he's got to have the respect of the students," Barton said.

Littky said he believes the degrees and the nickname are only part of his problem with the Winchester School Board. Part, he said, is his appearance and the fact that he lives alone more than half of each year in an isolated cabin on Pudding Hill without electricity or running water.

"I don't fit the image of what some people think a principal should be," he said. "If I were married, had a family and went to church on Sunday, I'd probably do better."

The rest, he said, is an inbred resistance to change. "If you really teach kids well, they start questioning," he said, "and some people don't like to be questioned."

Littky came to Winchester in 1978 looking for a break from a career in the New York City public schools and as principal of the Shoreham-Wading River Middle School on Long Island.

"I only planned to stay here a few years," he recalled. "But then I really became committed to the town."

After he helped revive the local newspaper, The Winchester Star, the school board hired him to take over at Thayer in 1981.

At the time, the town was among the poorest in the state, according to the 1980 census. Median household income here, $12,447, ranked 220th among the state's 234 cities and towns.

At Thayer that year, only six of 44 graduating seniors chose to continue their educations, and some of their parents felt that student ringleaders had turned a defeatist attitude into a badge of honor.

"There were kids who were failing and happy to be failing," said Marcia Ammann, a school board member and a Littky supporter with two children at Thayer. "The tough kids had taken over."

Littky says he brought a "common-sense" approach to education at the high school, combining a 1960s-style concern for the individual with a 1980s-style demand for measurable achievement as students reach the next grade. "I want school to be a place where you know what you're doing, and where you accomplish something before you move on," he said.

By 1985, the last year for which state school board statistics are available, the share of graduates going on to post-secondary education had risen from 14 percent to 35 percent. According to Littky, more than half of the graduating classes of 1986 and 1987 are continuing school.

Word of Littky's record got around. Theodore R. Sizer, chairman of the education department at Brown University and author of a national study of high schools, included Thayer in his Coalition of Essential Schools, a group of high schools nationwide that seek ways to increase the time teachers spend with each student while strengthening graduation requirements.

But some school board members were unhappy with what they saw happening at Thayer.

When Terri Racine's teachers helped her devise an independent study project on teen-age pregnancy, some on the board concluded that Littky was promoting sex among students.

And an apprenticeship program, in which teachers structure academic studies around fields such as auto mechanics, nursing and teaching, convinced a board majority that Littky was not paying enough attention to basic education.

A board majority voted last year to restrict eligibility for the apprentice program to juniors and seniors and, earlier, to pull Thayer High out of Sizer's group -- an effort, according to Littky supporters, to push him out.

But Littky would not be pushed. The board then decided not to renew his contract and thus began a tug of war in which both sides have exhausted virtually every legal and political means at their disposal.

To avoid a public hearing on Littky's contract, board members voted to demote him to elementary school teacher. Littky sued the board and, after spending $35,000 in legal fees (on his $32,000 salary), won a hearing and a reply to his demand that board members explain the firing.

At the hearing last July, attended by several hundred people, the school board limited its criticism of Littky to broad matters of philosophy and style and reiterated its intention to find a new principal.

The state board of education is still considering Littky's appeal of the contract decision.

As the legal process dragged and Littky continued to run Thayer High, townspeople prepared for a March school board election, which many believed would clinch the matter. Among the seven candidates for two available seats were the two incumbents: Kendall Baker, a Littky supporter, and Robert Secord, a staunch Littky opponent. To win a three-member majority and retain the principal, Littky supporters would have had to reelect Baker and defeat Secord.

The election inspired more interest than any school board contest in memory. In this town of 3,790, the number of citizens who cast ballots increased by about 75 percent, from 525 the previous year to 918.

When the votes were tallied, Littky supporter Baker seemed to have won another term handily and Secord appeared to have lost narrowly. But the day was neither won nor lost. After a recount and allegations of voter fraud on both sides, a Superior Court judge called the election for Secord's seat a tie.

To prevent the contest from being decided by a coin toss, as required by New Hampshire law, the state legislature called a new election for both seats.

Tonight Baker won again and Secord was defeated, to be replaced by a Littky supporter. "My job next year is going to be to work very hard to pull this town back together," Littky said.

The results may quiet the controversy that followed Littky to the June 18 graduation ceremonies for the class of '87.

When anti-Littky school board members tried to bar the principal from delivering his usual address -- in which he typically offers a brief biographical sketch of each graduate and announces the graduate's plans -- protesting parents stormed a board meeting. Students, led by Terri Racine, delivered a letter to the board backing the principal.

"{Board Chairman} Al Barton told me he wanted a graduation with no emotion," Littky said, as he tried to explain the hullabaloo. "Those were his words: 'no emotion.' " But this time, the board relented.

When the principal took the stage on graduation day, there was no evidence of the conflict. As the sun set on a cloudless day, about 300 parents and friends sat on folding chairs in front of Thayer High to watch the town's annual rite of passage. Some cheered, and some cried.

But when Littky concluded his speech, everyone knew that he was as uncertain of his fate as his students were of theirs.

"I want each of you to keep your dignity and your self-respect," he told them. "In our hearts, we will always be together."