Prime Minister David Cameron, who was in his constituency in Oxfordshire, made the changes on the telephone, The Guardian reported. Justine Greening, who has been economic secretary to the Treasury since the Conservative-Liberal Democrat coalition took power in May 2010, was moved into the transport job.
Hammond was first elected to Parliament in 1997. He was expected to become treasury secretary in a Conservative government, but the party's failure to win an absolute majority in 2010 put him in transport.
The Guardian described him as a small-c conservative and as an expert on budgets.
Greening's promotion increases the number of women in the Cabinet to five. She has been in Parliament since 2005.
Fox had been under fire for a week over his relationship with Adam Werritty, a former housemate who served as best man at his wedding. Werritty, who has no official position, had accompanied Fox on a number of overseas trips and described himself as an "adviser."
While Fox has consistently denied any wrongdoing, he submitted his resignation after The Times of London reported Werritty appeared to have made money from the friendship.