WASHINGTON — President Obama, the Pentagon and leading lawmakers reached agreement Monday on legislative language and a time frame for repealing the military’s “don’t ask, don’t tell” policy, clearing the way for Congress to take up the measure as soon as this week.

It was not clear whether the deal had secured the votes necessary to pass the House and Senate, but the agreement removed the Pentagon’s objections to having Congress vote quickly on repealing the contentious 17-year-old policy, which bars gay men and lesbians from serving openly in the armed services.

House Democratic leaders were meeting Monday night and considering taking up the measure as soon as Thursday. But even if the measure passes, the policy cannot not change until after Dec. 1, when the Pentagon completes a review of its readiness to deal with the changes. Mr. Obama, his defense secretary and the chairman of the joint chiefs of staff would also be required to certify that repeal would not harm readiness.

The measure could enable gay men and lesbians to serve openly in the military for the first time, ending a policy that Mr. Obama, Defense Secretary Robert M. Gates and Adm. Mike Mullen, the chairman of the joint chiefs of staff, all say they oppose.