Sajid Javid's resignation marks victory for Boris Johnson's abrasive chief adviser Dominic Cummings in their bruising Whitehall power struggle.

Javid, the first British Asian to hold one of the great offices of state, was the first name to be announced when Johnson unveiled his new Cabinet after taking office in the heady days of July.

The appointment was seen as a reward for a strong performance in the early stages of the Tory leadership contest to succeed Theresa May before he was eliminated.

But within weeks, he was at loggerheads with Cummings - the mastermind of the successful Vote Leave campaign brought in by the new Prime Minister to head his No 10 operation.

The feud erupted when Cummings summarily sacked Javid's special adviser Sonia Khan, accusing her of remaining in contact with her former boss, ex-chancellor Philip Hammond.

The National: Sonia KhanSonia Khan

Javid, who was not informed in advance, was said to have been furious at the move, seen as a blatant power play by Cummings.

It set the pattern for an increasingly fraught relationship between the two men with markedly different visions for the direction the Government should be taking.

While Cummings was said to be keen to cast off spending constraints with extra cash for the police and the NHS, Javid - an orthodox Thatcherite - was determined to keep control of the public finances.

The National: Dominic CummingsDominic Cummings

The rift only deepened when Johnson returned to No 10 after December's general election victory promising to "level up" for the North and Midlands, where the Tories demolished Labour's hitherto impregnable "red wall".

It played out in press briefings, with allies of Cummings coining the nickname "Chino" - "chancellor in name only" - for the occupant of the Treasury.

But despite the tensions, Javid's position going into the reshuffle appeared to be secure, with the widespread expectation that he would be one of a number of senior ministers to keep their jobs.

With the Budget less than a month away, he was reported to be working well with Johnson, if not his top adviser.

Importantly, he was said to enjoy the support of the Prime Minister's girlfriend, Carrie Symonds, who had previously worked for him as a Tory adviser.

He had even appeared to have scored a victory over his rival with the announcement that the HS2 rail link would go ahead - a project which Javid publicly backed, while Cummings was a longstanding critic.

In contrast, there were suggestions Cummings's influence was on the wane - with Downing Street briefing it would be a "conventional" reshuffle, rather than the far more radical Cabinet overhaul Cummings was said to favour.

Certainly as he walked into Downing Street on Thursday morning - apparently to undergo the formalities of confirming his position - Javid could not have appeared more confident or relaxed.

But behind the famous black front door, all that quickly changed.

According to his allies, he was presented with an ultimatum to sack all his special advisers and replace them with a team chosen by No 10.

It was a classic ambush bearing all the hallmarks of Cummings.

According to a friend, Javid told the Prime Minister that it was an order which "no self-respecting minister would accept".

Chino was chancellor no more.