President-elect Barack Obama has asked V. Gene Robinson, the openly gay Episcopal bishop of New Hampshire, to deliver the invocation at an inaugural event on Sunday on the steps of the Lincoln Memorial.

Gay rights advocates saw the move as a way to compensate for Mr. Obama’s decision to give the Rev. Rick Warren, a prominent megachurch pastor from California who opposes same-sex marriage, the high-profile role of delivering the invocation at the inauguration next week.

Bishop Robinson advised Mr. Obama on gay rights issues during the campaign. He is the first openly gay bishop in the Episcopal Church, and his consecration in 2003 set off a growing rift in that church’s parent body, the Anglican Communion. Since then, Bishop Robinson has become an internationally known spokesman for gay rights  a hero to some and an object of scorn to others.

In a telephone interview on Monday, Bishop Robinson said that he believed his inclusion in inaugural events had been under consideration before the controversy erupted over Mr. Warren but that Mr. Obama and his team were also seeking to heal the pain that Mr. Warren’s selection had caused among lesbian, gay, bisexual and transgender advocates.