Oscar H. Nielson, 66, a federal government official for nearly 40 years, ded Thursday at Arlington Hospital. He had suffered from cancer.

Mr. Nielson served in the State Department from 1963 until retiring for reasons of health in 1973. There he was executive director of the bureau of international organization affairs and a special assistant to the assistant secretary of state for international organization affairs. He also acted as a liaison officer between the State Department and this country's mission at the United Nations.

He held a number of positions in the Commerce Department between 1945 and 1963. Among these were budget and management analyst, deputy director of the office of budget and management, assistant to the Secretary of Commerce and acting maritime commissioner during 1962.

Mr. Nielson began his government career in 1934 as an accounting and auditing clerk with the Home Owners Loan Corporation and was later on the staff of the Works Progress Administration.

He was born in Oakley, Idaho, and earned a law degree at National University in Washington.

He is survived by his wife, Mary, of the home in Alexandria; a daughter, Kay Perkins, of Alexandria; a son, Philip J., of Arlington; three brothers, Norman H., of Burley, Idaho, Leo H., of Washington, and Horton H., of New York City, and four grandchildren.