Exhibit 10.4

SECOND AMENDMENT TO AMENDED AND RESTATED CAPITAL

EXPENDITURE AND EQUIPMENT AGREEMENT

THIS SECOND AMENDMENT TO THE AMENDED AND RESTATED CAPITAL EXPENDITURE AND
EQUIPMENT AGREEMENT (this “Amendment”) is effective as of January 30, 2014 (the
“Amendment Effective Date”) between

ACELRX PHARMACEUTICALS, INC.,

a corporation existing under the laws of the State of Delaware, located at 575
Chesapeake Drive, Redwood City, California 94063 (“AcelRx”)

-and-

PATHEON PHARMACEUTICALS INC.,

a corporation existing under the laws of the State of Delaware, located at 2110
East Galbraith Road, Cincinnati, Ohio 45237-1625 (“Patheon”).

BACKGROUND

AcelRx and Patheon entered into an Amended and Restated Capital Expenditure and
Equipment Agreement dated December 11, 2012 as amended July 26, 2013 (the
“Agreement”). The purpose of this Amendment is to revise the Agreement to
include additional capital for Phase III manufacturing Facility Modifications.

AGREEMENT

NOW, THEREFORE, in consideration of the rights conferred and the obligations
assumed herein, the receipt and sufficiency of which are hereby acknowledged,
and intending to be legally bound, the parties hereby agree as follows:

 

  1. Amendment

 

  (a) In Section 3(b), Expenditures and Payment, and Section 4(a), Patheon Use
of Facility Modifications and Dedicated Equipment, the reference to “$3,669,404
is deleted and is replaced with “$4,382,912.”

 

Page 1 of 3

--------------------------------------------------------------------------------

  (b) Schedule B of the Agreement is deleted in its entirety and is replaced
with the attached “REVISED SCHEDULE B.”

 

  (c) The “Background” section of this document is expressly incorporated into
this Amendment.

 

  2. General

All other terms and conditions of the Agreement shall continue unchanged and
remain in full force and effect.

IN WITNESS WHEREOF the duly authorized representatives of the parties have
executed this Agreement.

 

ACELRX PHARMACEUTICALS, INC.     PATHEON PHARMACEUTICALS INC. By:  

/s/ James Welch

    By:  

/s/ Francis P. McCune

Name:  

James Welch

    Name:  

Francis P. McCune

Title:  

CFO

    Title:  

Secretary

 

Page 2 of 3

--------------------------------------------------------------------------------

Revised Schedule B

 

Facility Modifications

  

Phase I

  

Renovated space for process room and corridor with white zone finishes, Cat3B
gowning, material airlock, CII Security

   $ 434,202   

Utility modifications: existing unit HVAC once thru air, THP monitoring,
Compressed air piping, piped Chilled water, piped Purified water, piped city
water, Portable Cat3b central vacuum, portable CAT3b dust collection, Misting
shower, 230V and 110V power, bottled nitrogen

   $ 390,068   

Engineering Cost. This cost will be charged on a time and materials basis, and
is estimated to be equal to 12% of the total cost of the first two line items in
this table.

   $ 98,912   

Facility Qualification Cost. This cost will be charged on a time and materials
basis, and is estimated to be equal to 5% of the total cost for the first two
line items in this table.

   $ 41,214   

Contingency. This cost covers charges for items that have not yet been
determined, and is estimated to be equal to 15% of the total cost for the first
two line items in this table.

   $ 123,641   

Cartridge filling line Facility Support

   $ 10,500   

Total Phase I

   $ 1,098,537   

Phase II—Bldg. 6 Packaging/Processing Suites

  

Renovated space for 2 additional processing rooms, all with white zone finishes,
material airlock modifications, CII security. (Direct cost $480,437)

  

Utility modifications: new HVAC unit with once thru air sized for Phase 2 and 3,
additional THP monitoring, compressed air piping, piped Purified water, piped
city water, new CAT3b central vacuum,new Cat3b dust collection, 230 V and 110 V
power, piped nitrogen.waster water collection system. (Direct cost $1,467,190)

   $ 1,947,627   

Contingency (15% of direct costs ($292,144))

   $ 292,144   

Engineering Cost (12%)

   $ 233,715   

Qualification Cost (5%)

   $ 97,381   

Total Phase II

   $ 2,570,867   

Phase III—Bldg. 6 Processing Suite and associated support areas

  

Processing room, equipment storage and wash-up area, gowning and material
airlocks, CII security and access corridor.

   $ 225,335   

Utility modifications, including HVAC, facility and process piping, electrical
service and THP & controls.

   $ 315,505   

Engineering Cost (12%)

   $ 64,500   

Qualification Cost (5%)

   $ 27,042   

Contingency (15%)

   $ 81,126   

Total Phase III

   $ 713,508   

Total Facility Modifications

   $ 4,382,912   

 

Page 3 of 3