DURHAM, N.H. — An anonymous donor has agreed to pay up to $20,000 to cover expenses the town incurs as a result of a visit by President Barack Obama, Town Council Chairman Jay Gooze said Sunday.

The town asked that local expenses for today’s Obama campaign stop be covered by the president’s re-election campaign. Durham officials had said that the visit is expected to cost the town an extra $20,000 to $30,000 in overtime payments. Obama is scheduled to speak today at Durham’s Oyster River High School.

The Obama campaign had responded to the request by saying that all decisions on security expenses “are exclusively within the control of the appropriate government officials” and that if there were further questions about allocation of the expenses they should be directed to the Secret Service.

On Sunday, Gooze said the town’s request was not motivated by partisan politics and most Durham voters are registered Democrats. Gooze also said the town did not wish to make a national statement about campaign reimbursements.

“We have more than enough civic work on our plate,” Gooze said in a statement released after a news conference. “To be clear, our request came from the basic responsibility that a local government has to its residents to ensure that expenses outside our approved budget are recovered in a fair and equitable manner.”

The council chairman said an anonymous donor who lives in Durham had offered to pay for town public safety costs up to $20,000.

“The donor wanted us to make public his/her sentiment that our town had done the right thing in asking the campaign to do its part,” Gooze said. “We are grateful for this generous offer.”

Gooze said Durham residents “will welcome the president with open arms and the proud members of our police and fire departments will do their jobs with honor.”