Exhibit 5.1

img95396496_0.gif

June 12, 2026

Barrett Business Services, Inc.
8100 NE Parkway Dr
Vancouver, WA 98662

Subject: Form S-8 Relating to Second Amended and Restated 2020 Stock Incentive Plan (the “Second Restated Plan”)

Ladies and Gentlemen

Reference is made to the Registration Statement on Form S-8 (the “Registration Statement”) to be filed by Barrett Business Services, Inc., a Maryland corporation (the “Company”), with the Securities and Exchange Commission for the purpose of registering under the Securities Act of 1933, as amended (the “Securities Act”), an additional 1,200,000 shares of the Company’s common stock, $.01 par value (the “Registered Shares”), issuable under the Company’s Second Restated Plan.

In connection with this opinion, we have examined and relied upon originals or copies, certified or otherwise identified to our satisfaction, of (i) the Registration Statement, (ii) the Second Restated Plan, (iii) the Company’s Charter and Bylaws, each as currently in effect, and (iv) such corporate records, certificates of public officials, and other documents as we have deemed necessary or relevant as a basis for the opinion set forth herein. As to certain factual matters, we have relied on a certificate of an officer of the Company and have not independently verified such matters.

This opinion letter is based as to matters of law solely on the General Corporation Law of the State of Maryland, as amended. We express no opinion herein as to any other laws, statutes, ordinances, rules, or regulations.

Based upon, subject to and limited by the foregoing, we are of the opinion that, following (a) effectiveness of the Registration Statement, (b) issuance of the Registered Shares in accordance with the terms of the Second Restated Plan and the instruments executed pursuant to the Second Restated Plan governing the awards to which the Registered Shares relate, and (c) receipt by the Company of the consideration for the Registered Shares specified in the applicable resolutions of the Board of Directors or a duly authorized committee thereof and in the Second Restated Plan or any such instruments, the Registered Shares will be validly issued, fully paid, and nonassessable.

1140 SW Washington St, Ste 700 | Portland, OR 97205

img95396496_1.jpg


Barrett Business Services, Inc. img95396496_2.gif

June 12, 2026

Page 2

 

We consent to the use of this opinion and to the use of our name wherever it appears in the Registration Statement and in any amendments thereof. In giving this consent, we do not thereby admit that we are in the category of persons whose consent is required under Section 7 of the Securities Act.

This opinion is provided as of the date hereof, and we disclaim any obligation to advise you of facts, circumstances, or developments which hereafter may be brought to our attention and which may alter or affect our opinion. Our opinion is expressly limited to the matters set forth above, and we render no opinion, whether by implication or otherwise, as to any other matters relating to the Company, the Registered Shares, or the Second Restated Plan.

Very truly yours,

img95396496_3.jpg

MILLER NASH LLP

 

 

img95396496_1.jpg