Tsongas, 61, widow of former U.S. senator and presidential candidate Paul Tsongas, won the 5th District Congressional race with 51 percent, or 54,085 votes, to Ogonowski's 45 percent, or 47,424 votes.
She also defeated independents Patrick Murphy of Lowell, Kurt Hayes of Boxborough, and Constitution Party candidate Kevin Thompson of Brockton.
The Lowell Democrat expects to be sworn in as early as Thursday. She replaces Martin T. Meehan, who stepped down in July to become the University of Massachusetts Lowell chancellor.
Tsongas won by wide margins in Lawrence and Lowell, but narrowly lost to Ogonowski in Andover and Methuen, and squeaked past him in Haverhill.
Last night Tsongas pledged to go to Washington to bring U.S. troops home from Iraq. She also said she'd vote to override President George W. Bush's veto of funds for a popular children's health care program. That could be her first vote if she's sworn in Oct. 18 as expected.
Tsongas, flanked by her daughters, Ashley, Katina and Molly, as well as Paul Tsongas's sister, Thaleia Schlesinger, said she was moved by the stories of the many people she'd met traveling the 5th District's 29 cities and towns.
"To all of these people - and countless others like them - my message is simple," Tsongas said to her supporters at a local brew pub. "Let's get to work."
She is the first woman to represent Massachusetts in Congress since Margaret Heckler in 1983. She's the first woman elected to Congress from this state since Louise Day Hicks of Boston in 1970.
Paul Tsongas died in 1997 of side effects from the cancer that prompted him to retire from the Senate in 1985. He beat fellow Democrat Bill Clinton in the 1992 New Hampshire primary during a period of remission.
Asked about the close race, she said, "I talked about bringing an end to the war by putting on place a timetable (to withdraw troops) and the importance of funding children health insurance. A majority of this district understands what this was about."
Ogonowski, 50, of Dracut, conceded defeat around 10:30 p.m. But speaking to supporters at a Dracut restaurant, he hardly sounded defeated.