Senator Ted Stevens of Alaska was defeated in his bid for re-election on Tuesday.

Mr. Stevens, a Republican and a 40-year incumbent, was trailing his Democratic challenger, Mayor Mark Begich of Anchorage, by 3,724 votes out of more than 315,000 cast after state election officials on Tuesday counted about 25,000 absentee and other outstanding ballots.

Only an estimated 2,500 ballots remain to be counted next week, according to Gail Fenumiai, the state elections director.

“I am humbled and honored to serve Alaska in the United States Senate,” Mr. Begich said. “It’s been an incredible journey getting to this point, and I appreciate the support and commitment of the thousands of Alaskans who have brought us to this day.”

Mr. Stevens did not immediately concede the race. Presuming the results are certified, the senator could request a recount, but he would have to pay for it.