A London mayor who was accused by the Panorama programme of diverting £2m in public grants allegedly to shore up his vote has complained of racism and Islamophobia by the BBC.

The flagship current affairs show claimed Lutfur Rahman, executive mayor of the east end borough of Tower Hamlets, increased taxpayer funding to Bangladeshi and Somali groups from £1.5m to £3.6m despite council officer recommendations. Panorama said he used funds from the council's reserves and reduced what was left for other organisations by 25% overall.

Hours before Panorama was broadcast on Monday night, Eric Pickles, the secretary of state for communities announced an inquiry into the claims citing "a worrying pattern of divisive community politics and mismanagement of council staff and resources by the mayoral administration". He said he would consider using legal powers against the borough which is led by Rahman, a Bangladesh-born former Labour politician who became independent after he was dropped by the party.

Rahman accused the BBC of allowing the programme to be used for political campaigning ahead of May's local and mayoral elections. A council spokesman confirmed Rahman had decided to spread funding but denied any check was made of the ethnicity of people running receiving organisations and said the council officer's recommendations were no more than "work in progress" assessments.

Rahman revealed he had acquired a dossier of internal Panorama documents passed on by a researcher who worked on the programme. She took copies of the production files, including the script, research notes, translations and details about secret filming from a shared but secure database. Rahman claimed these revealed "clear racist and Islamophobic overtones targeting the Bangladeshi Muslim community in Tower Hamlets" and that the broadcaster had breached its editorial guidelines.

"The BBC's targeting of our borough is nothing short of a direct intervention in the outcome of an election," he said.

The leak is now being investigated as a possible breach of the data protection act, the Information Commissioner's Office said. It is understood that among the documents were sensitive files relating to a separate documentary about Northern Ireland.

On Monday, Rahman's office arranged for the researcher to speak to journalists and she claimed some of the production processes were racist and manipulative. His supporters also circulated a rebuttal documentary online which praised Rahman's record.

The researcher, who declined to give her name or to supply supporting documents, told The Guardian she was hired in January as a Bengali speaker to work on the programme and was asked to determine, by looking at names only, whether trustees of charities which received council grants were of Bangladeshi origin. She said she felt this was "ethnic profiling".

"The approaches they took were just unethical," she said. "There was manipulation, there was racism involved. I see them as Islamophobic bullies."

A spokesperson for the BBC said: "We strongly reject any suggestion of racial, religious or political motivation in the making or broadcast of Monday's programme, which investigates matters of legitimate public interest regarding an elected official."

They added: "We can confirm that there has been a breach of data protection at an independent production company working with the BBC on a Panorama investigation as a result of unauthorised disclosure by a former researcher on the production team, in breach of her obligation of confidentiality. This breach includes material relating to the programme's confidential sources. Our primary concern is to protect our sources and we are urgently investigating the matter."