The magnetic structure of the edge sharing cuprate compound Li2CuO2 has been investigated by means of ab initio electronic structure calculations. The first and second neighbor in-chain magnetic interactions are calculated to be -142 K and 22 K, respectively. The ratio between the two parameters is smaller than suggested previously in the literature. The interchain interactions are antiferromagnetic in nature and of the order of a few Kelvins only. Monte Carlo simulations using the ab initio parameters to define the model Hamiltonian result in a Neel temperature in rather good agreement with experiment. Spin population analysis situate the magnetic moment on the copper and oxygen ions somewhere between the completely localized picture derived from experiment and the more delocalized picture based on local density calculations.Comment: 40 pages, 6 figures inbedded. To be published in Phys. Rev.