The present invention relates to a process for the preparation substantially pure propane-1-sulfonicacid-{3-[5-(4-chlorophenyl)-1H-pyrrolo[2,3-b]pyridine-3-carbonyl]-2,4-difluoro-phenyl}-amide or Vemurafenib of Formula (I).The present invention further relates to a process for the preparation substantially pure propane-1-sulfonic acid-{3-[5-(4-chlorophenyl)-1H-pyrrolo[2,3-b]pyridine-3-carbonyl]-2,4-difluoro-phenyl}-amide trifluoro methane sulfonic acid salt or Vemurafenib triflate of Formula (VII)