Speculation surrounding Apotheker's departure had been rife during the past few days with the HP board reacting following investor criticism of Apotheker's plan to migrate from hardware to focus on software and services.
Through the shake-up, Ray Lane moves from non-executive chairman to executive chairman of the board of directors, with the board intending to appoint a lead independent director.
Lane said the company was "fortunate to have someone of Meg Whitman’s calibre and experience step up to lead HP".
He added: "We are at a critical moment and we need renewed leadership to successfully implement our strategy and take advantage of the market opportunities ahead.
"Meg is a technology visionary with a proven track record of execution. She is a strong communicator who is customer focused with deep leadership capabilities."
HP's share price was $22.80 per share as trading closed yesterday, although reports of Apotheker's exit saw prices jump from $22.26 to nearly $25 during the day. Confirmation of Whitman's appointment was not made until after trading.
Replacing Apotheker is proving costly for HP though, with some reports suggesting his departure costing the company as much as $33m (£21.3m).
Moreover, the company's share price has dived from nearly $49 in February to below $25 over the past few weeks.
The move comes shortly after the company's third quarter results revealed that its printing division added $6.1bn (£3.7bn) to the IT giant's $31.2bn net revenues, down 1% year-on-year.
Sales of its commercial presses came in at $1.3bn for the quarter ending 31 July, down 7% year-on-year and 10% sequentially, although hardware units rose 1%, and sales were marginally up for the nine months.
HP appoints Whitman CEO as Apotheker ousted
HP has confirmed that former eBay head Meg Whitman has been appointed as president and chief executive officer following the departure of Leo Apotheker after just 10 months in the role.