Using density functional theory calculations we have found that K atoms in a PTCDA (3,4:9,10-perylenetetracarboxylic dianhydride) crystal form a quasi-one-dimensional (1D) K-O chain interacting with carboxylic oxygen of the terminal anhydride groups of PTCDA. The K-K distance in the chain (3.72 Angstrom) is commensurate to the periodicity of the organic semiconductor. We obtain that the K-O structure is stabilized by charge transfer from K to PTCDA molecules, forming prevalently ionic bonds: the electronic density of the chemistry induced gap states is essentially delocalized on the perylene core of PTCDA, while potassium appears spoiled of its charge. Band dispersion along the direction of molecular stack is evaluated to be 0.2 eV in pure PTCDA crystal and 0.5 eV in the K-doped system, confirming that the interaction occurs between different molecular planes.