Mechanical alloying technique was applied to prepare hard magnetic Sm_2Fe_17N_x compound powders. Staring from pure Fe and Sm powders, the formation process of hard magnetic Sm_2Fe_17N_x phase by mechanical alloying and subsequent solid state reaction was studied. As milled powders were found to consist of Sm-Fe amorphous and alpha-Fe phases in all compositions of Sm_xFe_100-x(x = 11, 13, 15, 17). The effects of starting composition on the formation of Sm_2Fe_17 intermetallic compound was investigated by heat treatment of mechanically-alloyed powders. When Sm content was 15 at.%, heat-treated powders consisted of nearly Sm_2Fe_17 single phase. For preparation of hard magnetic Sm_2Fe_17N_x powders, additional nitriding treatment was performed under N_2 gas flow at 450°C. The increase in the coercivity and remanence was proportional to the nitrogen content which increased drastically at first and then increased gradually as the nitriding time was extended to 3 hours.