
61 F.Supp.2d 1141 (1999)
Delila RANDALL, Widow and Representative of James W. Randall, Plaintiff,
v.
COMMISSIONER OF THE SOCIAL SECURITY ADMINISTRATION, Defendant.
No. CIV. 98-6172-JO.
United States District Court, D. Oregon.
August 17, 1999.
*1142 Ralph Wilborn, Eugene, OR, for Plaintiff.
William W. Youngman, Assistant United States Attorney, District of Oregon, United States Attorney's Office, Portland, OR, Richard E. Buckley, Social Security Administration, Office of General Counsel, Seattle, WA, for Defendant.

OPINION AND ORDER
ROBERT E. JONES, District Judge.
This matter is before the court on plaintiff's application for an award of attorney fees and expenses pursuant to the Equal Access to Justice Act ("EAJA"), 28 U.S.C. § 2412. Plaintiff applies for an award of $7,605.15 for attorney fees and $322.75 for expenses, totaling $7,928.26.
Plaintiff argues that the Commissioner's position was not substantially justified, because the ALJ's decision was inconsistent with precedent and therefore not reasonably based in law. 28 U.S.C. § 2412(d)(1). The Commissioner contests plaintiff's application for fees, arguing that the Commissioner was substantially justified when it denied plaintiff's request for benefits because this court initially affirmed the decision of the Administrative Law Judge ("ALJ"), evincing the possibility of two interpretations of the evidence.
After considering the parties' arguments, I grant plaintiff's application for attorney fees and expenses.


*1143 BACKGROUND
On March 14, 1995, plaintiff applied for disability insurance benefits ("DIB"), alleging an inability to work beginning June 23, 1994,[1] due to the residual effects of a stroke, three back surgeries, and interstitial pulmonary fibrosis. The application was denied initially and upon reconsideration. The ALJ denied benefits in a decision of November 27, 1996, which became the final decision of the Commissioner when the Appeals Council denied review on May 1, 1998.
I affirmed the ALJ's decision on March 19, 1999. On April 20, 1999, however, I granted plaintiff's motion to alter or amend the opinion and remanded the case to the ALJ for a determination of the onset date, consistent with Armstrong v. Commissioner, 160 F.3d 587 (9th Cir. 1998), and the precedent on which that decision is based. Because I was remanding the case, I ordered the ALJ to attempt to attain additional medical source statements from two of plaintiff's physicians.
On July 2, 1999, plaintiff filed the pending application for attorney fees and expenses.[2]

DISCUSSION
The EAJA provides for an award of attorney's fees and expenses to a prevailing party in a civil action against the United States.[3]See 28 U.S.C. § 2412. The EAJA creates a presumption that fees will be awarded to prevailing parties, see Thomas v. Peterson, 841 F.2d 332, 335 (9th Cir.1988), but the awarding of fees is not mandatory, see United States v. 313.34 Acres of Land, 897 F.2d 1473, 1477 (9th Cir.1989). The attorney's fees are not available to the prevailing party if the United States was "substantially justified" in its position. See 28 U.S.C. § 2412(d)(1). The government is "substantially justified" if it is "justified in substance or in the main  that is, justified to a degree that could satisfy a reasonable person." Pierce v. Underwood, 487 U.S. 552, 565, 108 S.Ct. 2541, 101 L.Ed.2d 490 (1988).
This definition is "no different from the `reasonable basis both in law and in fact' formulation adopted by the Ninth Circuit." Underwood, 487 U.S. at 565, 108 S.Ct. 2541. Thus, where the ALJ's decision is contrary to clearly established precedent, the government's legal position is not substantially justified. See Meinhold v. United States Dept. of Defense, 123 F.3d 1275, 1278 (9th Cir.1997).
The government's position may be substantially justified even though it lost on the merits in the underlying proceeding. See Underwood, 487 U.S. at 569, 108 S.Ct. 2541. Whether the government's position is substantially justified is determined by the court on the basis of the record "which is made in the civil action for which fees and other expenses are sought." 28 U.S.C. § 2412(d)(1)(B). It is the government's burden to prove substantial justification. See Bullfrog Films, Inc. v. Wick, 959 F.2d 782, 784 (9th Cir.1992).
In the instant case, both the ALJ and this court, in its first opinion and order, misapplied the law. Under Social Security Regulation ("SSR") 83-20 (1983) and Ninth Circuit precedent since 1991, the ALJ has an affirmative duty to obtain the necessary evidence to establish the onset date where, as in this case, the onset *1144 date is ambiguous and difficult to determine and where medical inferences need to be made. See, e.g., DeLorme v. Sullivan, 924 F.2d 841 (9th Cir.1991) (holding that if the "medical evidence is not definite concerning the onset date and medical inferences need to be made, SSR 83-20 requires the administrative law judge to call upon the services of a medical advisor and to obtain all evidence which is available to make the determination"); Morgan v. Sullivan, 945 F.2d 1079 (9th Cir.1991). Thus, because the Commissioner's position was contrary to the SSR and to Ninth Circuit precedent, the Commissioner's position was not substantially justified, and an award of attorney fees and expenses is appropriate in this case.

CONCLUSION
Plaintiff's application for attorney fees and expenses (# # 27, 28) under 28 U.S.C. § 2412 is GRANTED.
NOTES
[1]  On June 18, 1996, at a hearing, plaintiff changed his disability onset date to May 27, 1982.
[2]  Plaintiff states that the application was filed within 30 days of the court's April 20, 1999 order, in compliance with the EAJA, 28 U.S.C. § 2412(d)(2)(G). The application itself has a Date Filed of July 2, 1999 and is signed and dated July 2, 1999.
[3]  The EAJA provides attorney fees "incurred by that party in any civil action ... brought against the United States ... unless the court finds that the position of the United States was substantially justified ..." 28 U.S.C. § 2412(d)(1)(A).
