The agency won the business after a head-to-head pitch with WCRS.
Other competing agencies BETC London and Dare were knocked off the pitch at an earlier stage.
The previous incumbent on the account McCann London pulled out of the process following the departure of B&Q's marketing director, Katherine Paterson in September.
The pitch kicked off in July this year and was handled by an in-house consultant.
McCann had worked with B&Q for three years after winning the business following a pitch against WCRS, Miles Calcraft Briginshaw Duffy (MCBD), and Rapier.
Earlier this week, Kingfisher, B&Q’s parent company, handed MEC its consolidated £45 million media planning and buying business for its B&Q, TradePoint and Screwfix brands after a pitch.
B&Q has awarded its £40 million advertising account to Karmarama.