The present invention concerns a method for in vivo generation of a linear polynucleotide with 5' and 3' free ends from a vector having no free end, said linear polynucleotide being integrated into the host cell genome. The vector having no free end according to the present invention comprise the polynucleotide to be linearized or excised flanked by a cleavage site, said cleavage site being preferably not found in the host cell genome. The present invention also relates to the resulting cells and their uses, for example for production of proteins or other genes, biomolecules, biomaterials, transgenic plants, vaccines, transgenic animals or for treatment or prophylaxis of a condition or disorder in an individual.