We briefly review sources of cosmic rays, their composition and spectra as well as their propagation in the galactic and extragalactic magnetic fields, both regular and fluctuating. A special attention is paid to the recent results of the X-ray and gamma-ray observations that shed light on the origin of the galactic cosmic rays and the challenging results of Pierre Auger Observatory on the ultra high energy cosmic rays. The perspectives of both high energy astrophysics and cosmic-ray astronomy to identify the sources of ultra high energy cosmic rays, the mechanisms of particle acceleration, to measure the intergalactic radiation fields and to reveal the structure of magnetic fields of very different scales are outlined.