We use one-and-a-half dimensional particle-in-cell plasma simulations to study the interaction of a relativistic , strongly magnetized wind with an ambient medium . Such an interaction is a plausible mechanism which leads to generation of cosmological \gamma -ray bursts . We confirm the idea of Mészáros and Rees ( 1992 ) that an essential part ( about 20 % ) of the energy that is lost by the wind in the process of its deceleration may be transferred to high-energy electrons and then to high-frequency ( X-ray and \gamma -ray ) emission . We show that in the wind frame the spectrum of electrons which are accelerated at the wind front and move ahead of the front is nearly a two-dimensional relativistic Maxwellian with a relativistic temperature T = m _ { e } c ^ { 2 } \Gamma _ { { } _ { T } } / k \simeq 6 \times 10 ^ { 9 } \Gamma _ { { } _ { T } } K , where \Gamma _ { { } _ { T } } is equal to 200 \Gamma _ { 0 } with the accuracy of \sim 20 % , and \Gamma _ { 0 } is the Lorentz factor of the wind , \Gamma _ { 0 } \gtrsim 10 ^ { 2 } for winds outflowing from cosmological \gamma -ray bursters . Our simulations point to an existence of a high-energy tail of accelerated electrons with a Lorentz factor of more than \sim 700 \Gamma _ { 0 } . Large-amplitude electromagnetic waves are generated by the oscillating currents at the wind front . The mean field of these waves ahead of the wind front is an order of magnitude less than the magnetic field of the wind . High-energy electrons which are accelerated at the wind front and injected into the region ahead of the front generate synchro-Compton radiation in the fields of large-amplitude electromagnetic waves . This radiation closely resembles synchrotron radiation and can reproduce the non-thermal radiation of \gamma -ray bursts observed in the Ginga and BATSE ranges ( from a few keV to a few MeV ) . Synchrotron photons which are generated in the vicinity of the wind front may be responsible for the radiation of \gamma -ray bursts in the EGRET energy range above a few ten MeV . The spectrum of \gamma -ray bursts in high-energy \gamma -rays may extend , in principle , up to the maximum energy of the accelerated electrons which is about 10 ^ { 13 } ( \Gamma _ { 0 } / 10 ^ { 2 } ) ^ { 2 } eV in the frame of the \gamma -ray burster . \keywords acceleration of particles — radiation mechanism : nonthermal — gamma-ray : bursts — gamma-rays : theory