Media Republic has held the online planning and buying since 2002. Agency Republic will continue to handle online creative for the account.
O2 said that the change would "improve media commercial structures, which promises significant efficiencies."
Sally Cowdry, the O2 UK marketing director, said: "We've been taking stock over a long period and there has been a blurring between off and online media, especially from a customer point of view. So our media will be much more efficient and effective if it is bought together."