Barack Obama is set to reject the advice of the Pentagon by announcing on Wednesday night the withdrawal of up to 30,000 troops from Afghanistan by November next year, in time for the US presidential election.

The move comes despite warnings from his military commanders that recent security gains are fragile. They have been urging him to keep troop numbers high until 2013.

The accelerated drawdown will dismay American and British commanders in Kabul, who have privately expressed concern that the White House is now being driven by political rather than military imperatives.

"This is not something we feel entirely comfortable with," a Whitehall official told the Guardian.

Obama's nationally televised address, the sixth he has given since becoming president, is intended to mark the beginning of the end of American military deployment in Afghanistan, from a present high of almost 100,000 troops.

The White House confirmed that the withdrawal will be "significant".

Obama's decision is aimed at placating an American public tired of a 10-year war that has cost 1,522 US lives. The killing of Osama bin Laden added impetus to calls to pull out.

Nato commanders led by General David Petraeus have set out the risks of withdrawing too many troops too soon, and warned Obama there has been no noticeable dividend from the death of the al-Qaida leader. They had urged him to keep in place the bulk of the extra 30,000 troops he committed to the "surge" until the end of 2012, so a drawdown can begin in 2013. That would give the military another full "fighting season" to attack Taliban strongholds and target insurgent leaders.

"They say they need another full year of this," one official told the Guardian. "They want as much as possible for as long as possible."

This year's fighting season, which is now underway, has shown that the Taliban is still strong, despite the pounding given to them over the winter by ISAF forces. In the first week of June, there were 701 security incidents across Afghanistan.

The withdrawal has created deep divisions in Washington. The defence secretary, Robert Gates, argued for a modest reduction – at one point as low as 2,000 – citing the advice of US commanders in Afghanistan that they need to protect gains made during the winter against the Taliban.

But senior White House staff, conscious that the president has an election to fight next year, argued in favour of a reduction that would send a signal to the US public that an end to the war is in sight.

The Associated Press reported that Obama could announce 10,000 troops to be brought home by the end of the year, and a further 20,000 next year – all of the 30,000 extra troops he ordered to Afghanistan as part of the "surge" in 2009. That would still leave about 70,000 troops, with all combat troops scheduled to leave by 2014, provided that Afghan forces are ready to take over.

The US military could fill some of the gaps by keeping combat troops in place and pulling out mainly support staff.

The US drawdown is a compromise that will not satisfy Democratic party doves seeking a quick end to US involvement.

When Obama first became president, he lost out in his first major battle with the Pentagon. But, as he has grown in confidence, he has been more willing to take them on, ignoring Gates's advice to avoid US military involvement in Libya and now again on Afghanistan.

Gates, who, along with secretary of state Hillary Clinton, was scheduled to meet Obama at the White House to finalise the details, acknowledged on Tuesday that US political considerations as well as conditions on the ground in Afghanistan contributed to the decision.

He said the war's unpopularity in the US and with Congress had to play a significant part in the president's thinking.

David Cameron was told in advance about the scale of Obama's withdrawal of US forces, but the prime minister is not intending to make an immediate corresponding announcement on the scale of the British military drawdown that will start later this year. He is expected to delay his own announcement until next week.

The timeframe may reflect continuing tensions between Cameron and the military over the scale of troop reductions.

Until recently, the Ministry of Defence was expecting the White House to take a cautious approach. The likelihood of a substantial drawdown was described as being "miles off" what US officials were telling their counterparts in Whitehall.

In a BBC2 documentary, Afghanistan: War Without End?, to be shown on Wednesday night, General Sir Peter Wall, the head of the British army, appeared to challenge Cameron's intention to pull out of Afghanistan in 2015 regardless of the political or security position in the country.

Wall said that while the British army is "committed to deliver against that timeline … Whether or not it turns out to be an absolute timeline or a more conditions-based approach nearer the time, we shall find out."

In an interview for the programme, Cameron said he will withdraw troops from combat in 2015 irrespective of whether Afghanistan has been hardened against the return of al-Qaida by then: "No, the deadline is a deadline and it won't slip, because I'm very clear that the British people deserve to have a clear endpoint."

Cameron's determination to withdraw without conditions is expected to be fiercely criticised in a report from the Commons defence select committee, due to be published in the next fortnight. The Conservative chairman of the committee, James Arbuthnot, has been a strong advocate of a conditions-based timetable for withdrawal.