Telefonica (TEF.MC) said on Friday it had agreed to buy the 22 percent stake held by Mediaset Espana (TL5.MC) in pay-TV firm Distribuidora de Television (DTS), giving full ownership of the TV firm to the telecoms group. Spanish media group Prisa (PRS.MC) in May agreed to sell 56 percent of DTS, known as Canal+ in Spain, to Telefonica, which already held 22 percent of the company. Mediaset Espana said in a statement the sale of its stake was worth 295 million euros ($402.40 million). It will also receive 30 million euros for giving up its preferential right to acquire Prisa’s stake in DTS.