Nine months ago, Nancy Grasmick’s state career seemed over.

Gov. Martin O’Malley made no secret about his plans to remove the Maryland schools chief from the post she had held for nearly two decades. The state school board hires the superintendent, but O’Malley sought legislation to extend Grasmick’s term several months, so a board dominated by his appointees could take over. They could then let her go and recruit a replacement.

The attempt threatened to keep the nation’s longest-serving state schools chief from completing a defining goal of her career — one she had been working toward for about 15 years — a set of exams that students would be required to pass to graduate high school.

The Baltimore native, who was deafened for two years as a teenager by an allergic reaction to antibiotics, got a degree in elementary education from what is now Towson University. After that, she earned a master’s degree at Washington’s Gallaudet University, the nation’s only liberal arts school for the deaf.

Grasmick earned her doctorate from John Hopkins University in 1979, and two years later, she began teaching deaf children at William S. Baer School in Baltimore City.

“I found that teachers build lives,” Grasmick told The Examiner, “and I wanted to be a builder of some of those lives.”

After moving on to administrative positions in the Baltimore County school system and the state, the Maryland school board hired her as the state’s first female superintendent in 1991.

The quarrel with the governor began, many believe, in 2006, when O’Malley was mayor of Baltimore.

While O’Malley campaigned for governor, Grasmick attempted to take control of 11 of the worst-performing schools in the city. She said she was doing what was best for the children.

O’Malley, however, accused her of trying to make him look bad by conspiring with then-Gov. Robert Ehrlich. Grasmick, a registered Democrat, had been considered a possible running mate for the Republican Ehrlich, and her husband, lumber tycoon Louis Grasmick, had contributed to Ehrlich’s campaign.

The feud quickly escalated after O’Malley narrowly won the election, and the state school board, still full of Ehrlich appointees, awarded Grasmick a new, four-year contract.

The legislation that O’Malley strongly supported would have essentially ousted Grasmick. Senate President Mike Miller was to introduce the bill that would have pushed Grasmick’s term back from June until December, allowing a board packed with O’Malley appointees to keep the superintendent or reverse her new contract and hire someone else.

With legislative leaders publicly supporting the measure, it seemed likely to succeed.

But suddenly, Grasmick and O’Malley met during a closed-door meeting, and when the two emerged, they held a dramatic news conference. They were no longer enemies, they announced. They would work together for the sake of Maryland’s students.

Neither Grasmick or O’Malley are willing to talk about what happened.

“It was just the two of them,” said Bill Reinhard, spokesman for the state education department, “so no one really knows.”

But many with knowledge of the ordeal said the governor relented because he did not have enough support to pass the legislation. Grasmick did not contact the governor to lay out her case, but federal and state lawmakers who backed her did, according to sources who declined to be named because of the issue’s sensitivity. “I think he realized it was a nonstarter,” one source said.

Staff Writer Len Lazarick contributed to this report.